summaryrefslogtreecommitdiffstats
path: root/sys/cam
Commit message (Collapse)AuthorAgeFilesLines
* Make some improvements to r253322 to really rescan target, not a bus.mav2013-07-153-11/+18
| | | | Add there and in two more places checks for NULL on xpt_alloc_ccb_nowait().
* Fix an argument reversal in calls to scsi_read_element_status().ken2013-07-151-2/+2
| | | | | Reported by: Ulrich Spoerlein <uqs@FreeBSD.org> MFC after: 3 days
* When printing opcode description, map T_NODEVICE to Direct Access Device tomav2013-07-131-0/+4
| | | | handle REPORT LUNS, etc.
* Improve handling of 0x3F/0x0E "Reported LUNs data has changed" and 0x25/0x00mav2013-07-133-33/+48
| | | | | | | | | | "Logical unit not supported" errors. First initiates specific target rescan, second -- destroys specific LUN. That allows to automatically detect changes in list of device LUNs. This mechanism doesn't work when target is completely idle, but probably that is all what can be done without active polling. Reviewed by: ken Sponsored by: iXsystems, Inc.
* Const-ify the new da_delete_functions.scottl2013-07-121-5/+2
| | | | | | | | Remove a redundant sanity check Submitted by: Steven Hartland Obtained from: Netflix MFC after: 3 days
* Fix a problem with READ ELEMENT STATUS that occurs on someken2013-07-121-8/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changers that don't support the DVCID and CURDATA bits that were introduced in the SMC spec. These changers will return an Illegal Request type error if the bits are set. This causes "chio status" to fail. The fix is two-fold. First, for changers that claim to be SCSI-2 or older, don't set the DVCID and CURDATA bits for READ ELEMENT STATUS. For newer changers (SCSI-3 and newer), we default to setting the new bits, but back off and try the READ ELEMENT STATUS without the bits if we get an Illegal Request type error. This has been tested on a Qualstar TLS-8211, which is a SCSI-2 changer that does not support the new bits, and a Spectra T-380, which is a SCSI-3 changer that does support the new bits. In the absence of a SCSI-3 changer that does not support the bits, I tested that with some error injection code. (The SMC spec says that support for CURDATA is mandatory, and DVCID is optional.) scsi_ch.c: Add a new quirk, CH_Q_NO_DVCID that gets set for SCSI-2 and older libraries, or newer libraries that report errors when the DVCID/CURDATA bits are set. In chgetelemstatus(), use the new quirk to determine whether or not to set DVCID and CURDATA. If we get an error with the bits set, back off and try without the bits. Set the quirk flag if the read element status succeeds without the bits set. Increase the READ ELEMENT STATUS timeout to 60 seconds after testing with a Spectra T-380. The previous value was 10 seconds, and too short for the T-380. This may be decreased later after some additional testing and investigation. Tested by: Andre Albsmeier <Andre.Albsmeier@siemens.com> Sponsored by: Spectra Logic MFC after: 3 days
* Refactor the various delete methods out of dastart(). Cleans up a bunchscottl2013-07-121-231/+262
| | | | | | | of style and adds more modularity and clarity. Obtained from: Netflix MFC after: 3 days
* Added 4K QUIRK for OCZ Vertex 4 SSDssmh2013-07-092-0/+16
| | | | | Submitted by: Borja Marcos <borjam@sarenet.es> MFC after: 2 days
* Make it little bit more C++ friendly. This explicit casting fixes somejkim2013-07-041-1/+1
| | | | ports, emulators/virtualbox-ose and sysutils/smartmontools for example.
* Bump disk(9) ABI version to signify the addition of d_delmaxsize by r249940.smh2013-07-031-1/+1
| | | | | | | | | | | Ensure that d_delmaxsize is always set, removing init to 0 which could cause future issues if use cases change. Allow kern.cam.da.X.delete_max (which maps to d_delmaxsize) to be increased up to the calculated max after being reduced. MFC after: 1 day X-MFC-With: r249940
* Fix NULL-deference kernel panic on attempt of destroying non-existingmav2013-07-031-8/+3
| | | | ramdisk-backed CTL LUN.
* Introduce accessors for the ccb status word. Convert one (of many more)scottl2013-06-292-13/+26
| | | | | | | | modules to use it, will convert the others once the appropriate shed color is selected by consensus. Obtained from: Netflix MFC after: 3 days
* Fix some UTF-8 chars slipped into r252204 via copy/paste.mav2013-06-261-8/+8
|
* Add bunch of names for Seagate and HGST vennor-specififc ASC/ASCQ codes.mav2013-06-251-0/+186
|
* Corrected ATA Passthrough defines from decimal to hexsmh2013-06-201-4/+4
| | | | | Reviewed by: scottl MFC after: 1 week
* Fix an unfortunate typo with the compat shimsscottl2013-06-191-3/+3
| | | | | Obtained from: Netflix MFC after: now
* Add infrastructure for doing compatibility shims, as has been sorelyscottl2013-06-175-1/+168
| | | | | | | | | | | | | | needed for the last 10 years. Far too much of the internal API is exposed, and every small adjustment causes applications to stop working. To kick this off, bump the API version to 0x17 as should have been done with r246713, but add shims to compensate. Thanks to the shims, there should be no visible change in application behavior. I have plans to do a significant overhaul of the API to harnen it for the future, but until then, I welcome others to add shims for older versions of the API. Obtained from: Netflix
* Restore use of polling mode for disk cache flush in case of kernel panic.mav2013-06-152-4/+19
| | | | | While I am not sure that any extra hardware access is a good idea after panic, that is an existing behaviour that should better work correctly.
* Revert r251649:mav2013-06-132-6/+0
| | | | | ken@ noticed that with recently added d_gone() disk method GEOM already holds reference on the periph, so we don't need another one.
* Make CAM return and GEOM DISK pass through new GEOM::lunid attribute.mav2013-06-124-12/+108
| | | | | | | | | | | | | | | | | | SPC-4 specification states that serial number may be property of device, but not a specific logical unit. People reported about FC storages using serial number in that way, making it unusable for purposes of LUN multipath detection. SPC-4 states that designators associated with logical unit from the VPD page 83h "Device Identification" should be used for that purpose. Report first of them in the new attribute in such preference order: NAA, EUI-64, T10 and SCSI name string. While there, make GEOM DISK properly report GEOM::ident in XML output also using d_getattr() method, if available. This fixes serial numbers reporting for SCSI disks in `geom disk list` output and confxml. Discussed with: gibbs, ken Sponsored by: iXsystems, Inc. MFC after: 2 weeks
* Acquire periph reference when handling d_getattr() method call.mav2013-06-122-0/+6
| | | | | | | | While GEOM in general has provider opened while sending BIO_GETATTR, GEOM DISK does not really need to open disk to read medium-unrelated attributes for own use. Proposed by: ken
* Simplify the checking of flags for cam_periph_mapmem(). This gets rid ofscottl2013-06-074-78/+42
| | | | | | | | a lot of code redundancy and grossness at very minor expense. Reviewed by: smh Obtained from: Netflix MFC after: 3 days
* Added missing SCSI quirks from r241784smh2013-05-282-45/+209
| | | | | | | | | | | | | | | | | Re-ordered SSD quirks alphabetically so they are easier to maintain. Removed my email and PR reference from comments on each quirk. Added quirks for more SSDs: * Crucial M4 * Corsair Force GT * Intel 520 Series * Kingston E100 Series * Samsung 830 Series Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 1 week
* Enforce validation on the selected delete method via sysctl.smh2013-05-241-1/+2
| | | | | | | | | This prevents users from selecting a delete method which may cause corruption e.g. MPS WS16 on pre P14 firmware. Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 days
* Added output of device QUIRKS for CAM and AHCI devices during boot.smh2013-05-187-2/+55
| | | | | | Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Suppress error printing for "PREVENT ALLOW MEDIUM REMOVAL" on da open.mav2013-05-121-1/+1
| | | | | Change at r250208 exposed more errors here, hidden before. The same flag is used in cd driver.
* Intel's 320-series and 510-series SSDs advertise 512-byte sectorseadler2013-05-111-0/+16
| | | | | | | | sizes for both logical and physical. Add ADA_Q_4K quirks for both. PR: kern/178040 Submitted by: Jeremy Chadwick <jdc@koitsu.org>
* Disable sending Early R_OK on SiI3726/SiI3826 port multipliers.mav2013-05-111-3/+82
| | | | | | | | | | With "cached read" HDD testing and multiple ports busy on a SATA host controller, 3726/3826 PMP will very rarely drop a deferred R_OK that was intended for the host. Symptom will be all 5 drives under test will timeout, get reset, and recover. Submitted by: Rich Futyma <rich.futyma@sanmina.com> MFC after: 2 weeks
* Fxi a bunch of typos.eadler2013-05-103-5/+5
| | | | | PR: misc/174625 Submitted by: Jeremy Chadwick <jdc@koitsu.org>
* Rework r250298 in more correct way.mav2013-05-061-5/+3
|
* Fix byte order of ATA WWN when converting it to SCSI LUN ID.mav2013-05-061-2/+5
|
* Tune support for removable media in da driver:mav2013-05-031-17/+13
| | | | | | | | - remove DA_FLAG_SAW_MEDIA flag, almost opposite to DA_FLAG_PACK_INVALID, using the last instead. - allow opening device with no media present, reporting zero media size and non-zero sector size, as geom/notes suggests. That allow to read device attributes and potentially do other things, not related to media.
* Enable CAM SCSI to choice ATA TRIM during autodetection and correct methodsmh2013-05-021-3/+3
| | | | | | | | names after increasing the priority of ATA TRIM. Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week
* Use the existence of ATA Information VPD to determine if we should attemptsmh2013-05-022-19/+73
| | | | | | | | | | | | | | | | | to query ATA functionality via ATA Pass-Through (16) as this page is defined as "must" for SATL devices, hence indicating that the device is at least likely to support Pass-Through (16). This eliminates errors produced by CTL when ATA Pass-Through (16) fails. Switch ATA probe daerror call to SF_NO_PRINT to avoid errors printing out for devices which return invalid errors. Output details about supported and choosen delete method when verbose booted. Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week
* Fix probe in progress check in dareprobesmh2013-05-021-1/+1
| | | | | | Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week
* Update probe flow so that devices with lbp can also disable disksort.smh2013-05-021-31/+34
| | | | | | | | | | | | | | | | Ensure that delete_available is reset so re-probes after a media change, to one with different delete characteristics, will result in the correct methods being flagged as available. Make all ccb state changes use a consistent flow: * free() * xpt_release_ccb() * softc->state = <new state> * xpt_schedule() Reviewed by: mav Approved by: pjd (mentor) MFC after: 1 week
* Correct a few sizeof()seadler2013-05-011-1/+1
| | | | | Submitted by: swildner@DragonFlyBSD.org Reviewed by: alfred
* Correct comment typo'ssmh2013-04-282-3/+7
| | | | | | | | Add missing comment Reviewed by: pjd (mentor) Approved by: pjd (mentor) MFC after: 2 weeks
* Add some cam_freeze_devq()'s missed at r249466.mav2013-04-281-0/+3
| | | | | | This makes number of freezes match the number of releases. Reported by: dim
* MFprojects/camlock r249542:mav2013-04-272-43/+10
| | | | | | | Remove ADA_FLAG_PACK_INVALID flag. Since ATA disks have no concept of media change it only duplicates CAM_PERIPH_INVALID flag, so we can use last one. Slightly cleanup DA_FLAG_PACK_INVALID use.
* MFprojects/camlock r249541:mav2013-04-271-13/+8
| | | | | | Give periph validity flag own periph reference. That slightly simplifies the release logic and covers hypothetical case if lock is dropped inside the periph_oninval() method.
* Added automatic detection of non-rotating media which disables thesmh2013-04-263-8/+111
| | | | | | | | | use of BIO queue sorting, hence optimising performance for devices such as SSD's Reviewed by: scottl Approved by: pjd (mentor) MFC after: 2 weeks
* Teach GEOM and CAM about the difference between the max "size" of r/w and deletesmh2013-04-262-2/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requests. sys/geom/geom_disk.h: - Added d_delmaxsize which represents the maximum size of individual device delete requests in bytes. This can be used by devices to inform geom of their size limitations regarding delete operations which are generally different from the read / write limits as data is not usually transferred from the host to physical device. sys/geom/geom_disk.c: - Use new d_delmaxsize to calculate the size of chunks passed through to the underlying strategy during deletes instead of using read / write optimised values. This defaults to d_maxsize if unset (0). - Moved d_maxsize default up so it can be used to default d_delmaxsize sys/cam/ata/ata_da.c: - Added d_delmaxsize calculations for TRIM and CFA sys/cam/scsi/scsi_da.c: - Added re-calculation of d_delmaxsize whenever delete_method is set. - Added kern.cam.da.X.delete_max sysctl which allows the max size for delete requests to be limited. This is useful in preventing timeouts on devices who's delete methods are slow. It should be noted that this limit is reset then the device delete method is changed and that it can only be lowered not increased from the device max. Reviewed by: mav Approved by: pjd (mentor)
* Added available delete methods discovery during device probe, including thesmh2013-04-261-76/+566
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maximum sizes for said methods, which are used when processing BIO_DELETE requests. This includes updating UNMAP support discovery to be based on SBC-3 T10/1799-D Revision 31 specification. Added ATA TRIM support to cam scsi devices via ATA Pass-Through(16) sys/cam/scsi/scsi_da.c: - Added ATA Data Set Management TRIM support via ATA Pass-Through(16) as a delete_method - Added four new probe states used to identity available methods and their limits for the processing of BIO_DELETE commands via both UNMAP and the new ATA TRIM commands. - Renamed Probe states to better indicate their use - Added delete method descriptions used when informing user of issues. - Added automatic calculation of the optimum delete mode based on which method presents the largest maximum request size as this is most likely to result in the best performance. - Added WRITE SAME max block limits - Updated UNMAP range generation to mirror that used by ATA TRIM, this optimises the generation of ranges and fixes a potential overflow issue in the count when combining multiple BIO_DELETE requests - Added output of warnings about short deletes. This should only ever be triggered on devices that fail to correctly advertise their supported delete modes / max sizes. - Fixed WS16 requests being incorrectly limited to 65535 in length. Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Refactored scsi_xpt use of device_has_vpd to generic scsi_vpd_supported_pagesmh2013-04-263-21/+36
| | | | | | | | | | | so its available for use in generic scsi code. This is a pre-requirement for using VPD queries to determine available SCSI delete methods within scsi_da. Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Updated TRIM calculations in cam/ata to be based off ATA_DSM_* definessmh2013-04-261-14/+24
| | | | | | Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Added the ability to send ATA identify and Data Set Management (DSM) TRIMsmh2013-04-262-0/+118
| | | | | | | | | | | | | | | | | | | | | | | | commands to an ATA device attached via a SCSI control. sys/cam/scsi/scsi_all.c: - Added scsi_ata_identify, scsi_ata_trim 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_identify, scsi_ata_trim methods used in ATA TRIM support. - Added scsi_vpd_logical_block_prov structure used when querying for the supported sizes UNMAP commands. - Added scsi_vpd_block_limits structure used when querying for the supported sizes of the UNMAP command. Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Removed unneeded tests in dadeletemethodset changing it to return voidsmh2013-04-261-7/+4
| | | | | | Reviewed by: mav Approved by: pjd (mentor) MFC after: 2 weeks
* Fix compilation.ken2013-04-201-8/+4
| | | | Pointy hat to: ken
* Expose CAM_BOOT_DELAY as a kernel conf item now.sbruno2013-04-201-0/+7
| | | | | | | | | This allows users who boot without loader to adjust their environments around slightly buggy or slow hardware. PR: kern/161809 Submitted by: rozhuk.im@gmail.com MFC after: 2 weeks
OpenPOWER on IntegriCloud