summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
...
* Update chio(1) and ch(4) to support reporting element designators.ken2013-04-192-58/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows mapping a tape drive in a changer (as reported by 'chio status') to a sa(4) driver instance by comparing the serial numbers. The designators can be ASCII (which is printed out directly), binary (which is printed in hex format) or UTF-8, which is printed in either native UTF-8 format if the terminal can support it, or in %XX notation for non-ASCII characters. Thanks to Hiroki Sato <hrs@> for the explaining UTF-8 printing and example UTF-8 printing code. chio.h: Modify the changer_element_status structure to add new fields and definitions from the SMC3r16 spec. Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and define a new CHIOGSTATUS ioctl. Clean up some tab/space issues. chio.c: For the 'status' subcommand, print the designator field if it is supplied by a device. scsi_ch.h: Add new flags for DVCID and CURDATA to the READ ELEMENT STATUS command structure. Add a read_element_status_device_id structure for the data fields in the new standard. Add new unions, dt_or_obsolete and voltage_devid, to hold and address data from either SCSI-2 or newer devices. scsi_ch.c: Implement support for fetching device IDs with READ ELEMENT STATUS data. Add new arguments to scsi_read_element_status() to allow the user to request the DVCID and CURDATA bits. This isn't compiled into libcam (it's only an internal kernel interface), so we don't need any special handling for the API change. If the user issues the new CHIOGSTATUS ioctl, copy all of the available element status data out. If he issues the OCHIOGSTATUS ioctl, we don't copy the new fields in the structure. Fix a bug in chopen() that would result in the peripheral never getting unheld if chgetparams() failed. Sponsored by: Spectra Logic Submitted by: Po-Li Soong MFC After: 1 week
* - Corrrect mispellings of word usefulgabor2013-04-171-1/+1
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
* - Correct mispellings of the word occurrencegabor2013-04-172-2/+2
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
* Remove some more pieces of multilevel freeze mechanism, missed in r249466.mav2013-04-141-16/+4
|
* Remove owner field from struct cam_ed, unused at least since FreeBSD 7.mav2013-04-142-2/+0
|
* MFprojects/camlock r248982:mav2013-04-144-11/+11
| | | | | | | | Stop abusing xpt_periph in random plases that really have no periph related to CCB, for example, bus scanning. NULL value is fine in such cases and it is correctly logged in debug messages as "noperiph". If at some point we need some real XPT periphs (alike to pmpX now), quite likely they will be per-bus, and not a single global instance as xpt_periph now.
* MFprojects/camlock r248890, r248897, r248898, r248900, r248903, r248905,mav2013-04-1415-422/+171
| | | | | | | | | | | | | | | | | | r248917, r248918, r248978, r249001, r249014, r249030: Remove multilevel freezing mechanism, implemented to handle specifics of the ATA/SATA error recovery, when post-reset recovery commands should be allocated when queues are already full of payload requests. Instead of removing frozen CCBs with specified range of priorities from the queue to provide free openings, use simple hack, allowing explicit CCBs over- allocation for requests with priority higher (numerically lower) then CAM_PRIORITY_OOB threshold. Simplify CCB allocation logic by removing SIM-level allocation queue. After that SIM-level queue manages only CCBs execution, while allocation logic is localized within each single device. Suggested by: gibbs
* MFprojects/camlock r248894:mav2013-04-131-4/+2
| | | | Use full freeze while PMP does hard reset. This is only cosmetical change.
* Remove ctl(4) from GENERIC. Also remove 'options CTL_DISABLE'trasz2013-04-125-34/+0
| | | | | | | | | | | and kern.cam.ctl.disable tunable; those were introduced as a workaround to make it possible to boot GENERIC on low memory machines. With ctl(4) being built as a module and automatically loaded by ctladm(8), this makes CTL work out of the box. Reviewed by: ken Sponsored by: FreeBSD Foundation
* Do not sent 120 TEST UNIT READY requests on generic NOT READY statuses.mav2013-04-111-5/+2
| | | | | | | | | | Some failing disks tend to return vendor-specific ASC/ASCQ codes with NOT READY sense key. It caused extremely long recovery attempts, repeating these 120 TURs (it takes at least 1 minute) for every I/O request. Instead of that use default error handling, doing just few retries. Reviewed by: ken, gibbs MFC after: 1 month
* Add a callback to the ada(4) driver so that it knows when GEOM has releasedken2013-04-101-0/+26
| | | | | | | | | | | | | | | | | | | | | | | references to it. This is the functional equivalent to change r237518, which added this functionality to the cd(4) and da(4) drivers. This fix prevents a panic caused by GEOM calling adaopen() while the device is going away. We now keep the device around until GEOM has finished cleaning up its state. ata_da.c: In adaregister(), add a d_gone callback to the GEOM disk structure registered for the ada driver. Increment the peripheral reference count for GEOM. Add a new callback, adadiskgonecb(), that GEOM calls when it is done with its resources. This callback releases the reference acquired in adaregister(). Submitted by: Po-Li Soong Sponsored by: Spectra Logic MFC After: 5 days
* Fix a memory leak that showed up when we delete LUNs. The memory used forken2013-04-081-4/+8
| | | | | | | | | | | the LUN was never freed. ctl.c: Adjust ctl_alloc_lun() to make sure we don't clear the CTL_LUN_MALLOCED flag. Reported by: Sreenivasa Honnur <shonnur@chelsio.com> Sponsored by: Spectra Logic MFC after: 3 days
* Remove extra semicolons from CAM_SIM_[UN]LOCK() macros.mav2013-04-071-2/+2
|
* - With the demise of !ATA_CAM, ATA_STATIC_ID is the only ata(4) relatedmarius2013-04-061-1/+0
| | | | | | | | | option left but actually consumed by ada(4), so move it to opt_ada.h and get rid of opt_ata.h. - Fix stand-alone build of atacore(4) by adding opt_cam.h. - Use __FBSDID. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers.
* Replicate r245306 from SCSI to ATA. The problem didn't appear so far,mav2013-04-061-0/+3
| | | | covered by multilevel freeze mechanism, but it is better to be safe.
* Unbreak ATA_NO_48BIT_DMA with ATA_CAM by treating 48-bit DMA as anmarius2013-04-064-29/+73
| | | | | | | optional property with PATA transport. Reviewed by: mav MFC after: 3 days
* Make SYNCHRONIZE CACHE work with LUNs backed by device files (as opposedtrasz2013-04-061-0/+1
| | | | | to regular files, which already worked fine). With this change, it's no longer neccessary to use "ctladm realsync off" workaround.
* MFprojects/camlock:mav2013-04-045-164/+148
| | | | | | | | | | | | | | | | r249017: Some cosmetic things: - Unify device to target insertion inside xpt_alloc_device() instead of duplicating it three times. - Remove extra checks for empty lists of devices and targets on release since zero refcount check also implies it. - Reformat code to reduce indentation. r249103: - Add lock assertions to every point where reference counters are modified. - When reference counters are reaching zero, add assertions that there are no children items left. - Add a bit more locking to the xptpdperiphtraverse().
* MFprojects/camlock r248931:mav2013-04-044-9/+9
| | | | | | Replace some direct mutex operations with wrappers. MFC after: 2 weeks
* MFprojects/camlock r248930:mav2013-04-043-48/+0
| | | | | | Remove extra NULL checks. d_drv1 can never be NULL during periph life cycle. MFC after: 2 weeks
* MFprojects/camlock r248928:mav2013-04-041-12/+22
| | | | | | | | Move CAM_DEBUG_CDB messages from the point of queuing to the point of sending to SIM. That allows to inspect real requests execution order, respecting priorities, freezing, etc. MFC after: 2 weeks
* Since the CTL version in FreeBSD does not support High Availability,trasz2013-04-041-1/+1
| | | | | | | ctl_is_single should always be set to 1. Make it so. Previously it was always 0, because ctl_isc_start() never got to run. Suggested by: ken
* Remove xpt_sim_opened(), the only consumer of which was atapicam, which ismav2013-04-042-34/+0
| | | | now gone.
* Use xpt_lock_buses() instead of equivalent mtx_lock(&xsoftc.xpt_topo_lock)mav2013-04-041-32/+32
| | | | to unify the code.
* Remove all legacy ATA code parts, not used since options ATA_CAM enabled inmav2013-04-041-4/+0
| | | | | | | | | most kernels before FreeBSD 9.0. Remove such modules and respective kernel options: atadisk, ataraid, atapicd, atapifd, atapist, atapicam. Remove the atacontrol utility and some man pages. Remove useless now options ATA_CAM. No objections: current@, stable@ MFC after: never
* Fix locking problem in ctl_maintenance_in() - one cannot use M_WAITOK or calltrasz2013-04-031-10/+9
| | | | | | | ctl_done() with mutex held. Reviewed by: ken Sponsored by: FreeBSD Foundation
* Add xpt_release_ccb()'s missed at r248872. That made `shutdown -p` stuckmav2013-04-032-0/+3
| | | | on controller with small number of queue slots and several disks connected.
* Fix sending virtual scatter/gather lists from the CTL CAM frontendken2013-04-021-1/+5
| | | | | | peripheral. Sponsored by: Spectra Logic
* Don't directly dereference userland pointer; instead use kernel pointertrasz2013-04-021-4/+4
| | | | | | | | copied in from userspace. This fixes instant panic when creating CTL LUN on sparc64. Not a security problem, since the API is root-only. Reviewed by: ken Sponsored by: FreeBSD Foundation
* Fix comment formatting.trasz2013-04-021-4/+4
|
* Remove unused code.trasz2013-04-021-30/+0
| | | | Reviewed by: ken
* Make it possible to build CTL as a module.trasz2013-04-025-30/+133
| | | | | Reviewed by: ken Sponsored by: FreeBSD Foundation
* Fix panic in the error path caused by recursive acquisition of XPT topologytrasz2013-04-021-1/+1
| | | | | | lock. Reviewed by: ken
* Added ATA Pass-Through support to CAMsmh2013-04-022-1/+76
| | | | | | | | | | | | | | | | | sys/cam/scsi/scsi_all.c: - Added scsi_ata_pass_16 method Which use ATA Pass-Through to send commands to the attached disk. sys/cam/scsi/scsi_all.h: - Added defines for all missing ATA Pass-Through commands values. - Added scsi_ata_pass_16 method. - Fixed a comment typo while I'm here Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Adds the ability to enable / disable sorting of BIO requests queued withinsmh2013-03-294-9/+55
| | | | | | | | | | | | | | | | | | | | | | | CAM. This can significantly improve performance particularly for SSDs which don't suffer from seek latencies. The sysctl / tunable kern.cam.sort_io_queues provides the systems default setting where:- 0 = queued BIOs are NOT sorted 1 = queued BIOs are sorted (default) Each device gets its own sysctl kern.cam.<type>.<id>.sort_io_queue Valid values are:- -1 = use system default (default) 0 = queued BIOs are NOT sorted 1 = queued BIOs are sorted Note: Additional patch will look to add automatic use of none sorted queues for none rotating media e.g. SSD's Reviewed by: scottl Approved by: pjd (mentor) MFC after: 2 weeks
* Unbreak compilation after r248868.marius2013-03-291-2/+2
|
* Make pre-shutdown flush and spindown routines to not use xpt_polled_action(),mav2013-03-292-42/+21
| | | | | | but execute the commands in regular way. There is no any reason to cook CPU while the system is still fully operational. After this change polling in CAM is used only for kernel dumping.
* Implement CAM_PERIPH_FOREACH() macro, safely iterating over the list ofmav2013-03-293-4/+43
| | | | | | | | driver's periphs, acquiring and releaseing periph references while doing it. Use it to iterate over the lists of ada and da periphs when flushing caches and putting devices to sleep on shutdown and suspend. Previous code could panic in theory if some device disappear in the middle of the process.
* On SIM destruction free associated CCBs, preallocated inside xpt_get_ccb().mav2013-03-271-0/+6
| | | | | | | | Before this change they were just leaked. Fortunately USB sticks now use only one CCB, and so leak was only 2KB per detach, while other bigger SIMs with much more allocated CCBs are rarely detached. MFC after: 2 weeks
* Remove two bzero()s that are erasing only few more bytes then set later.mav2013-03-251-2/+6
|
* Commit the removal of a whitespace to record the proper commit messagekib2013-03-191-1/+1
| | | | | | | | | | | | | | for the r248519: For the cam-attached HBAs, allow the driver to specify that it accepts the unmapped bio by the PIM_UNMAPPED flag. The CAM passes the CAM_DATA_BIO data transfer type request for the unmapped bio, and the driver could use the bus_dmamap_load_ccb() as a helper to transparently handle the ccb. Sponsored by: The FreeBSD Foundation Reviewed by: scottl Tested by: pho, scottl
* Support unmapped i/o for the md(4).kib2013-03-196-15/+39
| | | | | | | | | | The vnode-backed md(4) has to map the unmapped bio because VOP_READ() and VOP_WRITE() interfaces do not allow to pass unmapped requests to the filesystem. Vnode-backed md(4) uses pbufs instead of relying on the bio_transient_map, to avoid usual md deadlock. Sponsored by: The FreeBSD Foundation Tested by: pho, scottl
* Do not remap usermode pages into KVA for physio.kib2013-03-191-1/+1
| | | | | Sponsored by: The FreeBSD Foundation Tested by: pho
* Assert that a ccb passed to cam_periph_mapmem() for XPT_SCSI_IO andkib2013-03-191-0/+4
| | | | | | | XPT_ATA_IO holds virtual buffer address. Sponsored by: The FreeBSD Foundation Tested by: pho
* Re-enable CTL in GENERIC on i386 and amd64, but turn on the CTL disableken2013-03-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | tunable by default. This will allow GENERIC configurations to boot on small memory boxes, but not require end users who want to use CTL to recompile their kernel. They can simply set kern.cam.ctl.disable=0 in loader.conf. The eventual solution to the memory usage problem is to change the way CTL allocates memory to be more configurable, but this should fix things for small memory situations in the mean time. UPDATING: Explain the change in the CTL configuration, and how users can enable CTL if they would like to use it. sys/conf/options: Add a new option, CTL_DISABLE, that prevents CTL from initializing. ctl.c: If CTL_DISABLE is turned on, don't initialize. i386/conf/GENERIC, amd64/conf/GENERIC: Re-enable device ctl, and add the CTL_DISABLE option.
* Hide SEMB port of the SiI3826 Port Multiplier by default to avoid extramav2013-02-221-1/+3
| | | | | errors while it tries to talk via I2C to usually missing external SEP. There is tunable to enable it back when needed.
* Add DA_Q_NO_PREVENT quirk for Kingston DataTraveler G3 1.00 USB flash.mav2013-02-221-0/+4
| | | | | | PREVENT ALLOW MEDIUM REMOVAL commands return errors on these devices without returning sense data. In some cases unrelated following commands start to return errors too, that makes device to be dropped by CAM.
* Reform the busdma API so that new types may be added without modifyingkib2013-02-126-34/+43
| | | | | | | | | | | | | | | | | | | | | every architecture's busdma_machdep.c. It is done by unifying the bus_dmamap_load_buffer() routines so that they may be called from MI code. The MD busdma is then given a chance to do any final processing in the complete() callback. The cam changes unify the bus_dmamap_load* handling in cam drivers. The arm and mips implementations are updated to track virtual addresses for sync(). Previously this was done in a type specific way. Now it is done in a generic way by recording the list of virtuals in the map. Submitted by: jeff (sponsored by EMC/Isilon) Reviewed by: kan (previous version), scottl, mjacob (isp(4), no objections for target mode changes) Discussed with: ian (arm changes) Tested by: marius (sparc64), mips (jmallet), isci(4) on x86 (jharris), amd64 (Fabian Keil <freebsd-listen@fabiankeil.de>)
* Format CDB output as 2 digit hex correcting the lengthsmh2013-01-311-1/+1
| | | | | Approved by: pjd (mentor) MFC after: 1 week
* Sanitize the element descriptor string before using it as a device name.jh2013-01-241-2/+10
| | | | | Reported and tested by: Vitalij Satanivskij Reviewed by: gibbs, mav
OpenPOWER on IntegriCloud