#
267654 |
|
19-Jun-2014 |
gjb |
Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.
Approved by: re (implicit) Sponsored by: The FreeBSD Foundation |
#
256216 |
|
09-Oct-2013 |
mav |
MFC r249466, r249481, r250025: 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.
|
#
253037 |
|
08-Jul-2013 |
mav |
MFC r249468: 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.
|
#
251847 |
|
17-Jun-2013 |
mav |
MFC r250298, r250301: Fix byte order of ATA WWN when converting it to SCSI LUN ID.
|
#
251081 |
|
28-May-2013 |
marius |
MFC: r249199
Unbreak ATA_NO_48BIT_DMA with ATA_CAM by treating 48-bit DMA as an optional property with PATA transport.
Reviewed by: mav
|
#
249617 |
|
18-Apr-2013 |
mav |
MFC r249108: - Unify device to target insertion inside xpt_alloc_device() instead of duplicating it three times. - Reformat code to reduce indentation. - 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().
|
#
249152 |
|
05-Apr-2013 |
mav |
MFC r238886, r238892: Implement media change notification for DA and CD removable media devices. It includes three parts: 1) Modifications to CAM to detect media media changes and report them to disk(9) layer. For modern SATA (and potentially UAS) devices it utilizes Asynchronous Notification mechanism to receive events from hardware. Active polling with TEST UNIT READY commands with 3 seconds period is used for incapable hardware. After that both CD and DA drivers work the same way, detecting two conditions: "NOT READY: Medium not present" after medium was detected previously, and "UNIT ATTENTION: Not ready to ready change, medium may have changed". First one reported to disk(9) as media removal, second as media insert/change. To reliably receive second event new AC_UNIT_ATTENTION async added to make UAs broadcasted to all periphs by generic error handling code in cam_periph_error(). 2) Modifications to GEOM core to handle media remove and change events. Media removal handled by spoiling all consumers attached to the provider. Media change event also schedules provider retaste after spoiling to probe new media. New flag G_CF_ORPHAN was added to consumers to reflect that consumer is in process of destruction. It allows retaste to create new geom instance of the same class, while previous one is still dying. 3) Modifications to some GEOM classes: DEV -- to report media change events to devd; PART class already handles spoiling alike to orphan.
|
#
244020 |
|
08-Dec-2012 |
mav |
MFC r243571: Fix problem with the Samsung 840 PRO series SSD detection. The device reports support for SATA Asynchronous Notification in its IDENTIFY data, but returns error on attempt to enable that feature. Make SATA XPT of CAM only report these errors, but not fail the device.
|
#
241940 |
|
23-Oct-2012 |
mav |
MFC r241455: Don't duplicate path/ccb allocation code, use existing functions.
|
#
241937 |
|
23-Oct-2012 |
mav |
MFC r241404: Remove 'periph == NULL' check from bunch of periph drivers. This condition can never be true as functions are called from single place and the checks just pollute the code and confuse Clang Static Analyzer.
|
#
237327 |
|
20-Jun-2012 |
mav |
MFC r236814: One more major cam_periph_error() rewrite to improve error handling and reporting. It includes: - removing of error messages controlled by bootverbose, replacing them with more universal and informative debugging on CAM_DEBUG_INFO level, that is now built into the kernel by default; - more close following to the arguments submitted by caller, such as SF_PRINT_ALWAYS, SF_QUIET_IR and SF_NO_PRINT; consumer knows better which errors are usual/expected at this point and which are really informative; - adding two new flags SF_NO_RECOVERY and SF_NO_RETRY to allow caller specify how much assistance it needs at this point; previously consumers controlled that by not calling cam_periph_error() at all, but that made behavior inconsistent and debugging complicated; - tuning debug messages and taken actions order to make debugging output more readable and cause-effect relationships visible; - making camperiphdone() (common device recovery completion handler) to also use cam_periph_error() in most cases, instead of own dumb code; - removing manual sense fetching code from cam_periph_error(); I was told by number of people that it is SIM obligation to fetch sense data, so this code is useless and only significantly complicates recovery logic; - making ada, da and pass driver to use cam_periph_error() with new limited recovery options to handle error recovery and debugging in common way; as one of results, CAM_REQUEUE_REQ and other retrying statuses are now working fine with pass driver, that caused many problems before. - reverting r186891 by raj@ to avoid burning few seconds in tight DELAY() loops on device probe, while device simply loads media; I think that problem may already be fixed in other way, and even if it is not, solution must be different.
Sponsored by: iXsystems, Inc.
|
#
237305 |
|
20-Jun-2012 |
mav |
MFC r236602, r236613: Tune and add some missing CAM_DEBUG() points for better consistency.
|
#
236790 |
|
09-Jun-2012 |
mav |
r236666: ATA/SATA controllers have no idea about protocol of the connected device until transport will do some probe actions (at least soft reset). Make ATA/SATA SIMs to not report bogus and confusing PROTO_ATA protocol. Make ATA/SATA transport to fill that gap by reporting protocol to SIM with XPT_SET_TRAN_SETTINGS and patching XPT_GET_TRAN_SETTINGS results if needed.
|
#
236788 |
|
09-Jun-2012 |
mav |
MFC r236552: Remove some dead code that I doubt will ever be implemented.
|
#
236786 |
|
09-Jun-2012 |
mav |
MFC r236437: Rewrite enabling NCQ for SATA devices in a way more alike to SCSI TCQ. This allows to control it with `camcontrol negotiate adaX -T (en|dis)able` on the fly, same as for SCSI devices.
Sponsored by: iXsystems, Inc.
|
#
236784 |
|
09-Jun-2012 |
mav |
NFC r236393: Use AC_GETDEV_CHANGED async to notify ada driver about DMA and NCQ status change. Now that allows switching between PIO and DMA modes on the fly.
|
#
236782 |
|
09-Jun-2012 |
mav |
MFC r236234: Allow to change number of openings (used tags) for ATA/SATA devices via `camcontrol tags ... -N ...`. There is no need to tune it in usual cases, but some users want to have it for debugging purposes.
|
#
236779 |
|
09-Jun-2012 |
mav |
MFC r236228: Plug request and references leak caused by race between invalidated ond probe periph destruction and new incoming probe request.
This at least caused problems with SATA Port Multipliers hot-plug.
|
#
236778 |
|
09-Jun-2012 |
mav |
MFC r235897: - Add low-level support for SATA Enclosure Management Bridge (SEMB) devices -- SATA equivalents of the SCSI SES/SAF-TE devices. - Add some utility functions for SCSI SAF-TE devices access.
Sponsored by: iXsystems, Inc.
|
#
231251 |
|
09-Feb-2012 |
mav |
MFC r230912: Make CAM ATA honor old hw.ata.ata_dma and hw.ata.atapi_dma tunables.
Even having more specific hint.ata.X.mode controls, global ones are still could be useful from some points, including compatibility.
PR: kern/164651
|
#
225736 |
|
22-Sep-2011 |
kensmith |
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
Approved by: re (implicit)
|
#
223475 |
|
23-Jun-2011 |
mav |
Fix ATAPI breakage introduced by r223443. It made SCSI commands to ATAPI device to never complete, that caused probe process (system boot) stuck.
|
#
223443 |
|
22-Jun-2011 |
will |
Plumb support for the device advanced information CCB in the ATA XPT.
This was previously done only for SCSI XPT in r223081, on which the change in r223089 depended in order to respond to serial number requests. As a result of r223089, da(4) and ada(4) devices register a d_getattr for geom to use to obtain the information.
Reported by: ache Reviewed by: ken
|
#
223019 |
|
12-Jun-2011 |
mav |
Do not report CFA devices as ATAPI, even though IDENTIFY data look alike.
|
#
220886 |
|
20-Apr-2011 |
mav |
Add basic support for DMA-capable ATA disks on DMA-incapable controller. This is really rare situation these days, but still may happen in embedded.
|
#
220602 |
|
13-Apr-2011 |
mav |
Improve SATA Asynchronous Notification feature support in CAM: - make SATA SIMs announce capabilities to handle SDB with Notification bit; - make PMP driver honor this SIMs capability; - make SATA XPT to negotiate and enable this feature for ATAPI devices.
This feature allows supporting SATA ATAPI devices to inform system about some events happened, that may require attention. In my case this allows LG GH22LS50 SATA DVR-RW drive to report tray open/close events. Events reported to CAM in form of AC_SCSI_AEN async. Further they could be used as a hints for checking device status and reporting media change to upper layers, for example, via spoiling mechanism of GEOM.
|
#
217875 |
|
26-Jan-2011 |
mav |
In addition to r217444 ignore also ATA status errors on DMA Auto-Activation enabling request. Some HP disks reported to return ABORT error there while declaring support for this feature.
|
#
217874 |
|
26-Jan-2011 |
mav |
Make device initialization sequence shorter when possible. Do not enable/ disable already enabled/disabled SATA features.
|
#
217444 |
|
15-Jan-2011 |
mav |
Some old WD SATA disks report supported and enabled device-initiated interface power management, but return ABORT error on attempt to disable it. Make CAM SATA probe sequence ignore this error, as it is not fatal.
|
#
215454 |
|
18-Nov-2010 |
mav |
If HBA doesn't report user-enabled SATA capabilies (like ATA_CAM wrapper) - handle all of them as disabled. This was original cause of the problem, workarounded by r215453.
MFC after: 1 week
|
#
209744 |
|
06-Jul-2010 |
mav |
ATA device reset starts probe sequence from the beginning. If reset caused by timeout/error of one of probe commands, process may continue infinitely. Make CAM ATA more robust to faulty devices and false positive detections, abort probe after two restarts on timeouts or ten on other errors.
|
#
208823 |
|
05-Jun-2010 |
mav |
Add allocation error hadling.
Found with: Coverity Prevent(tm) CID: 3897
|
#
208582 |
|
26-May-2010 |
mjacob |
Add a new primitive, XPT_SCAN_TGT, to cover the range between scanning a whole bus (XPT_SCAN_BUS) and a single lun on that bus (XPT_SCAN_LUN).
It's less resource comsumptive than scanning a whole bus when the caller knows only one target has changes.
Reviewed by: scsi@ Sponsored by: Panasas MFC after: 1 month
|
#
208348 |
|
20-May-2010 |
marius |
Remove unnecessary headers which were inherited from cam_xpt.c without reason.
Reviewed by: mav MFC after: 3 days
|
#
207499 |
|
02-May-2010 |
mav |
Make SATA XPT negotiate and enable some additional SATA features, such as: - device initiated power management (some devices support only this way); - Automatic Partial to Slumber Transition (more power saving); - DMA auto-activation (expected to slightly improve performance). More features could be added later, when hardware supports.
|
#
207428 |
|
30-Apr-2010 |
mav |
Report PMP absence using target 15, same as for precence (not a wildcard), to not confuse target ID checks at SIMs.
|
#
207282 |
|
27-Apr-2010 |
mav |
Update device identify data and serial number when device change detected. Reprobe immediately following this should have fresh data.
|
#
207222 |
|
26-Apr-2010 |
mav |
MFp4: Move PI_TAG_ABLE check from ada driver to ATA XPT.
|
#
204354 |
|
26-Feb-2010 |
mav |
Make PUIS detection more strict. Previous implementation caused false positives on VMWare's virtual CD-ROMs.
|
#
204220 |
|
22-Feb-2010 |
mav |
Virtualize transport part of periph announcement.
|
#
203499 |
|
04-Feb-2010 |
mav |
On probe error, if restart requested, skip any retries and recovery. Just restart probe from the beginning immediately.
|
#
203421 |
|
03-Feb-2010 |
mav |
MFp4: Add Power Up In Stand-by feature support. Device with PUIS enabled require explicit command to do initial spin-up. Mark that command with CAM_HIGH_POWER flag, to allow CAM manage staggered spin-up.
|
#
203385 |
|
02-Feb-2010 |
mav |
- Use separate buffer for identify data fetching. We can't use main buffer here if device already running, as data need to be formatted before use. - Remove some saved_ccb variables. They are unused now.
|
#
203376 |
|
02-Feb-2010 |
mav |
- Give ATA/SATA SIMs info about ATAPI packet size, supported by device. - Make ATA XPT to reject longer SCSI CDBs then supported by device, or any SCSI CDBs, if device doesn't support ATAPI.
|
#
203108 |
|
28-Jan-2010 |
mav |
MFp4: Large set of CAM inprovements.
- 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.
|
#
201990 |
|
10-Jan-2010 |
mav |
- Report SATA in legacy emulation mode still as SATA. - Make ATA XPT able to handle such case.
|
#
200218 |
|
07-Dec-2009 |
mav |
MFp4; - Cleanup kernel messages, mostly PMP. - Took references on devices, while PMP reinitializes them, to not let them go and distort freeze reference counting.
|
#
200171 |
|
05-Dec-2009 |
mav |
MFp4: Introduce ATA_CAM kernel option, turning ata(4) controller drivers into cam(4) interface modules. When enabled, this options deprecates all ata(4) peripheral drivers (ad, acd, ...) and interfaces and allows cam(4) drivers (ada, cd, ...) and interfaces to be natively used instead.
As side effect of this, ata(4) mode setting code was completely rewritten to make controller API more strict and permit above change. While doing this, SATA revision was separated from PATA mode. It allows DMA-incapable SATA devices to operate and makes hw.ata.atapi_dma tunable work again.
Also allow ata(4) controller drivers (except some specific or broken ones) to handle larger data transfers. Previous constraint of 64K was artificial and is not really required by PCI ATA BM specification or hardware.
Submitted by: nwitehorn (powerpc part)
|
#
199799 |
|
25-Nov-2009 |
mav |
Fix small copu-paste bug.
|
#
199747 |
|
24-Nov-2009 |
mav |
MFp4: - Extend XPT-SIM transfer settings control API. Now it allows to report to SATA SIM number of tags supported by each device, implement ATA mode and SATA revision negotiation for both SATA and PATA SIMs. - Make ahci(4) and siis(4) to use submitted maximum tag number, when scheduling requests. It allows to support NCQ on devices with lower tags count then controller supports. - Make PMP driver to report attached devices connection speeds. - Implement ATA mode negotiation between user settings, device and controller capabilities.
|
#
199263 |
|
14-Nov-2009 |
mav |
MFp4: Do not enable tagged queueing if controller reports 0 tags support.
|
#
199178 |
|
11-Nov-2009 |
mav |
MFp4: - Move tagged queueing control from ADA to ATA XPT. It allows to control device command queue length correctly. First step to support < 32 tags. - Limit queue for non-tagged devices by 2 slots for ahci(4) and siis(4). - Implement quirk matching for ATA devices. - Move xpt_schedule_dev_sendq() from header to source file. - Move delayed queue shrinking to the more expected place - element freeing. - Remove some SCSIsms in ATA.
|
#
198897 |
|
04-Nov-2009 |
mav |
MFp4: - Add support for sector size > 512 bytes and physical sector of several logical sectors, introduced by ATA-7 specification. - Remove some obsoleted code.
|
#
198748 |
|
01-Nov-2009 |
mav |
MFp4: Fix reference counting bug, when device unreferenced before then invalidated. To do it, do not handle validity flag as another reference, but explicitly modify reference count each time flag is modified.
Discovered by: thompsa
|
#
198708 |
|
31-Oct-2009 |
mav |
MFp4: - Reduce code duplication in ATA XPT and PMP driver. - Move PIO size setting from ada driver to ATA XPT. It is XPT business to negotiate transfer details. ada driver is now stateless. - Report PIO size to SIM. It is required for correct PATA SIM operation. - Tune PMP scan timings. It workarounds some problems with SiI. - If reset hapens during PMP initialization - restart it. - Introduce early-initialized periph drivers, which are used during initial scan process. Use it for xpt, probe, aprobe and pmp. It gives pmp chance to finish scan before mountroot and numerate devices in right order.
|
#
198389 |
|
23-Oct-2009 |
mav |
MFp4: Move Port Multiplier support code out of ATA XPT into pmp periph driver. This is convinient, as PMP itself is a bus target and has own state.
|
#
198382 |
|
23-Oct-2009 |
mav |
Replace most of priority numbers with defines. No logical changes.
|
#
198331 |
|
21-Oct-2009 |
mav |
MFp4: Separate CAM_DEV_IDENTIFY_DATA_VALID flag from CAM_DEV_INQUIRY_DATA_VALID. Add workaround for very old devices without support for mode setting. Add some PATA bus scanning support. Remove some SCSIsms.
|
#
198322 |
|
21-Oct-2009 |
mav |
MFp4: Report real max_target = 15. SIM doesn't need to know that target 15 is PMP. It is XPT business.
|
#
196659 |
|
30-Aug-2009 |
mav |
Short ATA command format has 28bit address, not 36bit. Rename ata_36bit_cmd() into ata_28bit_cmd(), while it didn't become legacy.
MFC after: 2 days
|
#
196353 |
|
18-Aug-2009 |
mav |
Fix copy/paste bug, that requests data read during ATA device probe sequence for ATA_SETFEATURES/ATA_SF_SETXFER command which by definition transfers no data. Most of controllers are irrelevant to this bug, but some nVidia's doesn't.
Tested on: current@ Approved by: re (kib)
|
#
195665 |
|
13-Jul-2009 |
mav |
Fix copy-paste bug, enabling SIM PMP support, when it was not really found.
Approved by: re (implicitly)
|
#
195653 |
|
13-Jul-2009 |
mav |
Rename ATA probe driver to "aprobe" to resolve name conflict with SCSI and fix loading cam as module.
Approved by: re (implicitly)
|
#
195534 |
|
10-Jul-2009 |
scottl |
Separate the parallel scsi knowledge out of the core of the XPT, and 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
|