summaryrefslogtreecommitdiffstats
path: root/sys/dev/ciss
Commit message (Collapse)AuthorAgeFilesLines
* Add descriptor sense support to CAM, and honor sense residuals properly inken2011-10-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CAM. Desriptor sense is a new sense data format that originated in SPC-3. Among other things, it allows for an 8-byte info field, which is necessary to pass back block numbers larger than 4 bytes. This change adds a number of new functions to scsi_all.c (and therefore libcam) that abstract out most access to sense data. This includes a bump of CAM_VERSION, because the CCB ABI has changed. Userland programs that use the CAM pass(4) driver will need to be recompiled. camcontrol.c: Change uses of scsi_extract_sense() to use scsi_extract_sense_len(). Use scsi_get_sks() instead of accessing sense key specific data directly. scsi_modes: Update the control mode page to the latest version (SPC-4). scsi_cmds.c, scsi_target.c: Change references to struct scsi_sense_data to struct scsi_sense_data_fixed. This should be changed to allow the user to specify fixed or descriptor sense, and then use scsi_set_sense_data() to build the sense data. ps3cdrom.c: Use scsi_set_sense_data() instead of setting sense data manually. cam_periph.c: Use scsi_extract_sense_len() instead of using scsi_extract_sense() or accessing sense data directly. cam_ccb.h: Bump the CAM_VERSION from 0x15 to 0x16. The change of struct scsi_sense_data from 32 to 252 bytes changes the size of struct ccb_scsiio, but not the size of union ccb. So the version must be bumped to prevent structure mis-matches. scsi_all.h: Lots of updated SCSI sense data and other structures. Add function prototypes for the new sense data functions. Take out the inline implementation of scsi_extract_sense(). It is now too large to put in a header file. Add macros to calculate whether fields are present and filled in fixed and descriptor sense data scsi_all.c: In scsi_op_desc(), allow the user to pass in NULL inquiry data, and we'll assume a direct access device in that case. Changed the SCSI RESERVED sense key name and description to COMPLETED, as it is now defined in the spec. Change the error recovery action for a number of read errors to prevent lots of retries when the drive has said that the block isn't accessible. This speeds up reconstruction of the block by any RAID software running on top of the drive (e.g. ZFS). In scsi_sense_desc(), allow for invalid sense key numbers. This allows calling this routine without checking the input values first. Change scsi_error_action() to use scsi_extract_sense_len(), and handle things when invalid asc/ascq values are encountered. Add a new routine, scsi_desc_iterate(), that will call the supplied function for every descriptor in descriptor format sense data. Add scsi_set_sense_data(), and scsi_set_sense_data_va(), which build descriptor and fixed format sense data. They currently default to fixed format sense data. Add a number of scsi_get_*() functions, which get different types of sense data fields from either fixed or descriptor format sense data, if the data is present. Add a number of scsi_*_sbuf() functions, which print formatted versions of various sense data fields. These functions work for either fixed or descriptor sense. Add a number of scsi_sense_*_sbuf() functions, which have a standard calling interface and print the indicated field. These functions take descriptors only. Add scsi_sense_desc_sbuf(), which will print a formatted version of the given sense descriptor. Pull out a majority of the scsi_sense_sbuf() function and put it into scsi_sense_only_sbuf(). This allows callers that don't use struct ccb_scsiio to easily utilize the printing routines. Revamp that function to handle descriptor sense and use the new sense fetching and printing routines. Move scsi_extract_sense() into scsi_all.c, and implement it in terms of the new function, scsi_extract_sense_len(). The _len() version takes a length (which should be the sense length - residual) and can indicate which fields are present and valid in the sense data. Add a couple of new scsi_get_*() routines to get the sense key, asc, and ascq only. mly.c: Rename struct scsi_sense_data to struct scsi_sense_data_fixed. sbp_targ.c: Use the new sense fetching routines to get sense data instead of accessing it directly. sbp.c: Change the firewire/SCSI sense data transformation code to use struct scsi_sense_data_fixed instead of struct scsi_sense_data. This should be changed later to use scsi_set_sense_data(). ciss.c: Calculate the sense residual properly. Use scsi_get_sense_key() to fetch the sense key. mps_sas.c, mpt_cam.c: Set the sense residual properly. iir.c: Use scsi_set_sense_data() instead of building sense data by hand. iscsi_subr.c: Use scsi_extract_sense_len() instead of grabbing sense data directly. umass.c: Use scsi_set_sense_data() to build sense data. Grab the sense key using scsi_get_sense_key(). Calculate the sense residual properly. isp_freebsd.h: Use scsi_get_*() routines to grab asc, ascq, and sense key values. Calculate and set the sense residual. MFC after: 3 days Sponsored by: Spectra Logic Corporation
* Cosmetic: make it less confusing when displaying RAID 1 level, that mightkib2010-10-021-1/+1
| | | | | | | be 1+0 as well. PR: kern/150936 MFC after: 2 weeks
* Initialize the callout structure earlier in attach before calling anyjhb2010-04-281-1/+1
| | | | | routines that can fail since ciss_free() always tries to stop and drain the callout.
* Several changes to fix livelock under high load, introduced by r203489:mav2010-03-032-4/+12
| | | | | | - change the way in which command queue overflow is handled; - do not expose to CAM two command slots, used for driver's internal purposes; - allow driver to use up to 1024 command slots, instead of 256 before.
* When hacking INQUIRY result, make sure that it is right INQUIRY and theremav2010-02-051-2/+7
| | | | is enough of result to hack.
* Return CAM_RELEASE_SIMQ flag only when it is needed, when SIM reallymav2010-02-041-12/+10
| | | | was frozen before and should be released.
* MFp4: Large set of CAM inprovements.mav2010-01-281-42/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Unify bus reset/probe sequence. Whenever bus attached at boot or later, CAM will automatically reset and scan it. It allows to remove duplicate code from many drivers. - Any bus, attached before CAM completed it's boot-time initialization, will equally join to the process, delaying boot if needed. - New kern.cam.boot_delay loader tunable should help controllers that are still unable to register their buses in time (such as slow USB/ PCCard/ CardBus devices), by adding one more event to wait on boot. - To allow synchronization between different CAM levels, concept of requests priorities was extended. Priorities now split between several "run levels". Device can be freezed at specified level, allowing higher priority requests to pass. For example, no payload requests allowed, until PMP driver enable port. ATA XPT negotiate transfer parameters, periph driver configure caching and so on. - Frozen requests are no more counted by request allocation scheduler. It fixes deadlocks, when frozen low priority payload requests occupying slots, required by higher levels to manage theit execution. - Two last changes were holding proper ATA reinitialization and error recovery implementation. Now it is done: SATA controllers and Port Multipliers now implement automatic hot-plug and should correctly recover from timeouts and bus resets. - Improve SCSI error recovery for devices on buses without automatic sense reporting, such as ATAPI or USB. For example, it allows CAM to wait, while CD drive loads disk, instead of immediately return error status. - Decapitalize diagnostic messages and make them more readable and sensible. - Teach PMP driver to limit maximum speed on fan-out ports. - Make boot wait for PMP scan completes, and make rescan more reliable. - Fix pass driver, to return CCB to user level in case of error. - Increase number of retries in cd driver, as device may return several UAs.
* Don't panic due to unlocking an unowned mutex if we fail during attach.gavin2009-12-171-2/+5
| | | | | | | PR: kern/139053 Reviewed by: scottl Approved by: ed (mentor) MFC after: 2 weeks
* Sync driver with Yahoo:scottl2009-09-163-74/+75
| | | | | | | - Implement MSI support (MSIX support was already there) - Use a table to drive MSI/MSIX exceptions - Pre-calculate the command address instead of wasting cycles doing the calculation on every i/o.
* Fix locking around copyout() operations.scottl2009-09-161-3/+9
|
* Make MSI and PERFORMANT interrupts work correctly. Only require the minimumscottl2009-09-162-4/+13
| | | | | | | number of MSIX interrupts that are needed, and don't strictly check for 4. Enable enough interrupt mask bits so that the controller will generate interrupts in PERFORMANT mode. This fixes the hang-on-boot issues that people were seeing with newer controllers.
* Increase CISS_MAX_PHYSTGT to 256 so that it matches what the controller mightscottl2009-09-161-1/+1
| | | | | give us. Without this, certain data structures get sized incorrectly, leading to a panic on certain cards that want to use high-value target numbers.
* Fix an apparently harmless typo.scottl2009-07-201-1/+1
| | | | Approved by: re
* Revert the CISS driver to 64K i/o, the previous change was in error andscottl2009-07-131-1/+1
| | | | | | missing a lot of needed infrastructure. Approved by: re
* Separate the parallel scsi knowledge out of the core of the XPT, andscottl2009-07-102-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | modularize it so that new transports can be created. Add a transport for SATA Add a periph+protocol layer for ATA Add a driver for AHCI-compliant hardware. Add a maxio field to CAM so that drivers can advertise their max I/O capability. Modify various drivers so that they are insulated from the value of MAXPHYS. The new ATA/SATA code supports AHCI-compliant hardware, and will override the classic ATA driver if it is loaded as a module at boot time or compiled into the kernel. The stack now support NCQ (tagged queueing) for increased performance on modern SATA drives. It also supports port multipliers. ATA drives are accessed via 'ada' device nodes. ATAPI drives are accessed via 'cd' device nodes. They can all be enumerated and manipulated via camcontrol, just like SCSI drives. SCSI commands are not translated to their ATA equivalents; ATA native commands are used throughout the entire stack, including camcontrol. See the camcontrol manpage for further details. Testing this code may require that you update your fstab, and possibly modify your BIOS to enable AHCI functionality, if available. This code is very experimental at the moment. The userland ABI/API has changed, so applications will need to be recompiled. It may change further in the near future. The 'ada' device name may also change as more infrastructure is completed in this project. The goal is to eventually put all CAM busses and devices until newbus, allowing for interesting topology and management options. Few functional changes will be seen with existing SCSI/SAS/FC drivers, though the userland ABI has still changed. In the future, transports specific modules for SAS and FC may appear in order to better support the topologies and capabilities of these technologies. The modularization of CAM and the addition of the ATA/SATA modules is meant to break CAM out of the mold of being specific to SCSI, letting it grow to be a framework for arbitrary transports and protocols. It also allows drivers to be written to support discrete hardware without jeopardizing the stability of non-related hardware. While only an AHCI driver is provided now, a Silicon Image driver is also in the works. Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware is possible and encouraged. Help with new transports is also encouraged. Submitted by: scottl, mav Approved by: re
* We no longer need to use d_thread_t, migrate to struct thread *.imp2009-05-201-3/+3
|
* Updated PCI ID's from the vendorscottl2009-05-191-1/+4
|
* Tell CAM that CISS logical devices support tagged queueing. This fixesscottl2009-02-201-2/+5
| | | | | the low "max device openings" count that has led to poor performance in FreeBSD 7.0 and 7.1
* Work again to fix the interrupt masking problems. We now recognizescottl2008-08-292-37/+40
| | | | | | | that there are 3 different interrupt enable bits, 2 for different families of cards, and 1 for when MSI is used. Also apply a big hammer backstop for cards that aren't recognized. This should fix all of the interrupt issues at boot.
* Correctly set the interrupt enable and disable bits. The previousscottl2008-08-022-15/+11
| | | | | | code interfered with Performant mode and legacy interrupts. Also remove a register read operation on the Simplq code that was effectively a time-wasting no-op.
* A number of significant enhancements to the ciss driver:scottl2008-07-114-150/+494
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. The FreeBSD driver was setting an interrupt coalesce delay of 1000us for reasons that I can only speculate on. This was hurting everything from lame sequential I/O "benchmarks" to legitimate filesystem metadata operations that relied on serialized barrier writes. One of my filesystem tests went from 35s to complete down to 6s. 2. Implemented the Performant transport method. Without the fix in (1), I saw almost no difference. With it, my filesystem tests showed another 5-10% improvement in speed. It was hard to measure CPU utilization in any meaningful way, so it's not clear if there was a benefit there, though there should have been since the interrupt handler was reduced from 2 or more PCI reads down to 1. 3. Implemented MSI-X. Without any docs on this, I was just taking a guess, and it appears to only work with the Performant method. This could be a programming or understanding mistake on my part. While this by itself made almost no difference to performance since the Performant method already eliminated most of the synchronous reads over the PCI bus, it did allow the CISS hardware to stop sharing its interrupt with the USB hardware, which in turn allowed the driver to become decoupled from the Giant-locked USB driver stack. This increased performance by almost 20%. The MSI-X setup was done with 4 vectors allocated, but only 1 vector used since the performant method was told to only use 1 of 4 queues. Fiddling with this might make it work with the simpleq method, not sure. I did not implement MSI since I have no MSI-specific hardware in my test lab. 4. Improved the locking in the driver, trimmed some data structures. This didn't improve test times in any measurable way, but it does look like it gave a minor improvement to CPU usage when many processes/threads were doing I/O in parallel. Again, this was hard to accurately test.
* Add support for the P212, P410, P410i, P411, and P812 HP Smart Arrayps2008-06-101-0/+5
| | | | | | controllers. Submitted by: Scott Benesh at HP
* Remove a check that didn't allow > 12 byte CDB's to be issued tops2008-05-161-6/+0
| | | | | | ciss. This should allow volumes > 2TB to work. Reported by: Emil Mikulic
* Add `hw.ciss.nop_message_heartbeat' tunable (default disabled) foriwasaki2008-02-101-1/+4
| | | | | | | | | | | NOP-message polling in ciss_periodic(). Note that setting the tunable to non-zero can be workaround only for `ADAPTER HEARTBEAT FAILED' problem, and may freeze the system w/o the problem. Reviewed by: scottl Reported by: Attila Nagy MFC after: 3 days
* Don't repeat error logging about NOP message sending ifiwasaki2008-01-281-1/+5
| | | | | | | | ciss_report_request() return an error (which is most likely data underrun). Noticed by: Mark Atkinson MFC after: 1 week
* Fix NOP message sending in ciss_periodic() which causes panic withiwasaki2007-11-051-3/+16
| | | | | | | | option INVARIANTS. Reviewed by: simokawa Tested by: noriyosi_kawano MFC after: 1 week
* Rename the kthread_xxx (e.g. kthread_create()) callsjulian2007-10-201-3/+3
| | | | | | | | | | | to kproc_xxx as they actually make whole processes. Thos makes way for us to add REAL kthread_create() and friends that actually make theads. it turns out that most of these calls actually end up being moved back to the thread version when it's added. but we need to make this cosmetic change first. I'd LOVE to do this rename in 7.0 so that we can eventually MFC the new kthread_xxx() calls.
* Add NOP-message polling to ciss_periodic().iwasaki2007-10-131-1/+80
| | | | | | | | Disable adapter by detecting adapter is dead. Tested by: Masaki YATSU(on RELENG_6) Reviewed by: scottl MFC after: 1 week
* Fix a mistake made in the MPSAFE commit that caused CAM to serialize requestsscottl2007-10-121-1/+2
| | | | to the controller.
* Prepare for future integration between CAM and newbus. xpt_bus_registerscottl2007-06-171-2/+2
| | | | | | | now takes a device_t to be the parent of the bus that is being created. Most SIMs have been updated with a reasonable argument, but a few exceptions just pass NULL for now. This argument isn't used yet and the newbus integration likely won't be ready until after 7.0-RELEASE.
* Satisfy witness during shutdownscottl2007-06-051-0/+2
|
* Eliminate M_TEMP.scottl2007-05-141-3/+3
|
* Streamline locking in ciss_free()scottl2007-05-021-26/+27
|
* MPSAFE ciss driverscottl2007-05-012-20/+46
|
* Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM willscottl2007-04-151-2/+2
| | | | | | | | | | | use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down. The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled.
* o break newbus api: add a new argument of type driver_filter_t topiso2007-02-231-1/+1
| | | | | | | | | | | | | bus_setup_intr() o add an int return code to all fast handlers o retire INTR_FAST/IH_FAST For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current Reviewed by: many Approved by: re@
* o ciss.ko depends on cam and pci.maxim2006-11-301-0/+2
| | | | | | PR: kern/105989 Submitted by: nork MFC after: 1 month
* 2nd and final commit that moves us to CAM_NEW_TRAN_CODEmjacob2006-11-021-9/+0
| | | | | | as the default. Reviewed by multitudes.
* The first of 3 major steps to move the CAM layer forward to usingmjacob2006-10-311-3/+21
| | | | | | | | | | | | | | | | | | | | | the CAM_NEW_TRAN_CODE that has been in the tree for some years now. This first step consists solely of adding to or correcting CAM_NEW_TRAN_CODE pieces in the kernel source tree such that a both a GENERIC (at least on i386) and a LINT build with CAM_NEW_TRAN_CODE as an option will compile correctly and run (at least with some the h/w I have). After a short settle time, the other pieces (making CAM_NEW_TRAN_CODE the default and updating libcam and camcontrol) will be brought in. This will be an incompatible change in that the size of structures related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change in both size and content. However, basic system operation and basic system utilities work well enough with this change. Reviewed by: freebsd-scsi and specific stakeholders
* Spin until a request structure is available in the ioctl path.ps2006-05-301-2/+2
|
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-161-1/+0
| | | | unnecessary.
* Free another memory leak when dealing with disk notification.ps2006-04-201-1/+4
|
* Free some previously leaked memory on module unload.ps2006-04-191-2/+9
|
* It seems ciss should ignore overrun and underrun on a SCSI INQUIRYps2005-12-161-1/+4
| | | | | | | command. This fixes some weird booting issues on newer versions of the firmware on the MSA20. Reported by: Philippe Pegon <Philippe dot Pegon at crc dot u-strasbg dot fr>
* Update PCI ids to add the E200, E200i, P400, and P400i storageps2005-11-111-3/+8
| | | | | | controllers. Remove the E400 since it is not a real product. Submitted by: HP
* There's no reason to check the valence. This allows ciss to workps2005-08-092-8/+0
| | | | on the P600.
* Remove bus_{mem,p}io.h and related code for a micro-optimization on i386nyan2005-05-291-1/+0
| | | | | | and amd64. The optimization is a trivial on recent machines. Reviewed by: -arch (imp, marcel, dfr)
* Support passthru ioctl commands from 32bit binaries.ps2005-05-182-1/+30
|
* Add support for the P600 and name the E400.ps2005-04-281-1/+2
|
* Provide a way to soft reset a proxy controller such as an MSA20 orps2005-04-193-0/+58
| | | | | MSA500. This is useful if you need to reset one of the storage arrays on reboot.
OpenPOWER on IntegriCloud