summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
Commit message (Collapse)AuthorAgeFilesLines
* Move libata to drivers/ata.Jeff Garzik2006-08-101-3322/+0
|
* Merge branch 'upstream-fixes' into upstreamJeff Garzik2006-08-091-0/+13
|\
| * [PATCH] libata: clear sdev->locked on door lock failureTejun Heo2006-08-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | SCSI EH locks door if sdev->locked is set. Sometimes door lock command fails continuously (e.g. when medium is not present) and as libata uses EH to acquire sense data, this easily creates a loop where a failed lock door invokes EH and EH issues lock door on completion. This patch clears sdev->locked on door lock failure to break this loop. This problem has been spotted and diagnosed by Unicorn Chang <uchang@tw.ibm.com>. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | [PATCH] libata: Add support for SATA attachment to SAS adaptersBrian King2006-08-091-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following patch enhances libata to allow SAS device drivers to utilize libata to talk to SATA devices. It introduces some new APIs which allow libata to be used without allocating a virtual scsi host. New APIs: ata_sas_port_alloc - Allocate an ata_port ata_sas_port_init - Initialize an ata_port (probe device, etc) ata_sas_port_destroy - Free an ata_port allocated by ata_sas_port_alloc ata_sas_slave_configure - configure scsi device ata_sas_queuecmd - queue a scsi command, similar to ata_scsi_queuecomand These new APIs can be used either directly by a SAS LLDD or could be used by the SAS transport class. Possible usage for a SAS LLDD would be: scsi_scan_host target_alloc ata_sas_port_alloc slave_alloc ata_sas_port_init slave_configure ata_sas_slave_configure Commands received by the LLDD for SATA devices would call ata_sas_queuecmd. Device teardown would occur with: slave_destroy port_disable target_destroy ata_sas_port_destroy Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | [PATCH] libata: cosmetic changes to PM functionsTejun Heo2006-07-291-4/+4
|/ | | | | | | Unify pm_message_t argument to the new-style @mesg. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [PATCH] libata: reimplement per-dev PMTejun Heo2006-07-051-6/+115
| | | | | | | | | | | | | | | | | | | | | Reimplement per-dev PM. The original implementation directly put the device into suspended mode and didn't synchronize w/ EH operations including hotplug. This patch reimplements ata_scsi_device_suspend() and ata_scsi_device_resume() such that they request EH to perform the respective operations. Both functions synchronize with hotplug such that it doesn't operate on detached devices. Suspend waits for completion but resume just issues request and returns. This allows parallel wake up of devices and thus speeds up system resume. Due to sdev detach synchronization, it's not feasible to separate out EH requesting from sdev handling; thus, ata_device_suspend/resume() are removed and everything is implemented in the respective libata-scsi functions. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [PATCH] libata: implement ATA_EHI_RESUME_LINKTejun Heo2006-07-051-0/+1
| | | | | | | | | | | | | Implement ATA_EHI_RESUME_LINK, which indicates that the link needs to be resumed. This used to be implied by ATA_EHI_HOTPLUGGED. However, hotplug isn't the only event which requires link resume and separating this out allows other places to request link resume. This differentiation also allows better debounce timing selection. This patch converts user scan to use ATA_EHI_RESUME_LINK. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [PATCH] libata: add ap->pflags and move core dynamic flags to itTejun Heo2006-07-051-1/+1
| | | | | | | | | | ap->flags is way too clamped. Separate out core dynamic flags to ap->pflags. ATA_FLAG_DISABLED is a dynamic flag but left alone as it's referenced by a lot of LLDs and it's gonna be removed once all LLDs are converted to new EH. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [PATCH] Remove redundant NULL checks before [kv]free - in drivers/Jesper Juhl2006-06-271-3/+1
| | | | | | | | | Remove redundant NULL chck before kfree + tiny CodingStyle cleanup for drivers/ Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* [PATCH] libata: Add ata_scsi_dev_disabledBrian King2006-06-221-10/+31
| | | | | | | | | | Separate out parts of ata_scsi_find_dev to be reused in future SAS/SATA patches. Acked-by: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* [libata] Add host lock to struct ata_portJeff Garzik2006-06-221-10/+10
| | | | | | | | | | | | Prepare for changes required to support SATA devices attached to SAS HBAs. For these devices we don't want to use host_set at all, since libata will not be the owner of struct scsi_host. Signed-off-by: Brian King <brking@us.ibm.com> (with slight merge modifications made by...) Signed-off-by: Jeff Garzik <jeff@garzik.org>
* Merge branch 'master' into upstreamJeff Garzik2006-06-221-3/+3
|\ | | | | | | | | | | | | | | Conflicts: drivers/scsi/libata-core.c drivers/scsi/libata-scsi.c include/linux/pci_ids.h
| * [SCSI] remove scsi_request infrastructureChristoph Hellwig2006-06-101-1/+1
| | | | | | | | | | | | | | | | | | With Achim patch the last user (gdth) is switched away from scsi_request so we an kill it now. Also disables some code in i2o_scsi that was broken since the sg driver stopped using scsi_requests. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * [SCSI] fix up request buffer reference in various scsi driversChristoph Hellwig2006-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Various scsi drivers use scsi_cmnd.buffer and scsi_cmnd.bufflen in their queuecommand functions. Those fields are internal storage for the midlayer only and are used to restore the original payload after request_buffer and request_bufflen have been overwritten for EH. Using the buffer and bufflen fields means they do very broken things in error handling. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
* | [PATCH] libata: fix oops caused rescanning NULL sdevTejun Heo2006-06-121-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Depending on timing, ata_scsi_dev_rescan() might encounter a device which is enabled but not yet attached to sdev. On such cases, the original code caused oops. This patch makes ata_scsi_dev_rescan() rescan only device which are attached to sdevs. While at it, properly indent leading comment and add description about how it's synchronized with sdev attach/detach. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | [PATCH] Snoop SET FEATURES - WRITE CACHE ENABLE/DISABLE command(v5)zhao, forrest2006-06-121-0/+36
| | | | | | | | | | | | | | | | | | This patch makes libata snoop 'SET FEATURES - WRITE CACHE ENABLE/DISABLE' command, executing requisite revalidation processes to update cached data. Signed-off-by: Forrest Zhao <forrest.zhao@intel.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | [PATCH] libata-hp: hook warmplugTejun Heo2006-05-311-0/+1
| | | | | | | | | | | | Hook transportt->user_scan() and hostt->slave_destroy(). Signed-off-by: Tejun Heo <htejun@gmail.com>
* | [PATCH] libata-hp: implement warmplugTejun Heo2006-05-311-0/+89
| | | | | | | | | | | | | | | | | | Implement warmplug. User-initiated unplug can be detected by hostt->slave_destroy() and plug by transportt->user_scan(). This patch only implements the two callbacks. The next function will hook them. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | [PATCH] libata-hp: implement SCSI part of hotplugTejun Heo2006-05-311-0/+116
| | | | | | | | | | | | | | | | | | | | | | Implement SCSI part of hotplug. This must be done in a separate context as SCSI makes use of EH during probing. SCSI scan fails silently if EH is in progress. In such cases, libata pauses briefly and retries until every device is attached. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | [PATCH] libata-hp: implement ata_eh_detach_dev()Tejun Heo2006-05-311-0/+24
| | | | | | | | | | | | | | | | | | Implement ata_eh_detach_dev(). This function is responsible for detaching an ATA device and offlining the associated SCSI device atomically so that the detached device is not accessed after ATA detach is complete. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | [PATCH] libata-hp-prep: store attached SCSI deviceTejun Heo2006-05-311-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Add device persistent field dev->sdev and store the attached SCSI device. With hotplug, libata needs to know the attached SCSI device to offline and detach it, but scsi_device_lookup() cannot be used because libata will reuse SCSI ID numbers - dead but not gone devices (due to zombie opens, etc...) interfere with the lookup. dev->sdev doesn't hold reference to the SCSI device. It's cleared when the SCSI device goes away. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | [PATCH] libata-hp-prep: use __ata_scsi_find_dev()Tejun Heo2006-05-311-10/+6
| | | | | | | | | | | | Convert direct sdev -> dev lookup to __ata_scsi_find_dev(). Signed-off-by: Tejun Heo <htejun@gmail.com>
* | [PATCH] libata-hp-prep: update ata_scsi_find_dev() and friendsTejun Heo2006-05-311-15/+25
| | | | | | | | | | | | | | | | Separate out ata_find_dev() and __ata_scsi_find_dev() from ata_scsi_find_dev(). These will be used by later hotplug implementation. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | [libata] libata-scsi, sata_mv: trim trailing whitespaceJeff Garzik2006-05-241-1/+1
| |
* | [PATCH] libata - fix bracketing and DMA oopsAlan Cox2006-05-241-1/+6
| | | | | | | | | | | | | | | | The upstream tree has the ATA_DFLAG_PIO bug fixed but does not have the pass throuugh bug fix Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | [PATCH] SCSI: make scsi_implement_eh() generic API for SCSI transportsTejun Heo2006-05-201-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | libata implemented a feature to schedule EH without an associated EH by manipulating shost->host_eh_scheduled in ata_scsi_schedule_eh() directly. Move this function to scsi_error.c and rename it to scsi_schedule_eh(). It is now an exported API for SCSI transports and exported via new header file drivers/scsi/scsi_transport_api.h This patch also de-export scsi_eh_wakeup() which was exported specifically for ata_scsi_schedule_eh(). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | Merge branch 'max-sect' into upstreamJeff Garzik2006-05-151-1/+1
|\ \
| * \ Merge branch 'upstream'Jeff Garzik2006-04-121-173/+26
| |\ \
| * \ \ Merge branch 'upstream'Jeff Garzik2006-03-291-44/+45
| |\ \ \
| * | | | [PATCH] libata: increase LBA48 max sectors to 65535Tejun Heo2006-03-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | max_hw_sectors/max_sectors separation patch made into the tree, increase max_sectors to its hardware limit. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
* | | | | [PATCH] libata-ncq: implement NCQ device configurationTejun Heo2006-05-151-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all NCQ related stuff are in place, implement NCQ device configuration and bump ATA_MAX_QUEUE to 32 thus activating NCQ support. Original implementation is from Jens Axboe. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata-ncq: implement NCQ command translation and exclusionTejun Heo2006-05-151-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements NCQ command translation and exclusion. Note that NCQ commands don't use ata_rwcmd_protocol() to choose ATA command. This is because, unlike non-NCQ RW commands, NCQ commands can only be used for NCQ protocol and FUA handling is done with a flag rather than separate command. NCQ enabled device will have queue depth larger than one but no two non-NCQ commands can be issued simultaneously, neither can a non-NCQ command and NCQ commands. This patch makes ata_scsi_translate() return SCSI_MLQUEUE_DEVICE_BUSY if such exclusion is necessary. SCSI midlayer will retry the command later. As SCSI midlayer always retries once a command completes, this doesn't incur unnecessary delays and as most commands will be NCQ ones for NCQ device, so the overhead should be negligible. Initial implementation is from Jens Axboe and using SCSI_MLQUEUE_DEVICE_BUSY for exclusion is suggested by Jeff Garzik. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata-ncq: pass ata_scsi_translate() return value to SCSI midlayerTejun Heo2006-05-151-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ata_scsi_translate() will need to return SCSI_ML_QUEUE_DEVICE_BUSY to achieve exlusion between NCQ and non-NCQ commands or among non-NCQ commands. Pass its return value upward to SCSI midlayer. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata-eh-fw: update SCSI command completion path for new EHTejun Heo2006-05-151-11/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SCSI command completion path used to do some part of EH including printing messages and obtaining sense data. With new EH, all these are responsibilities of the EH, update SCSI command completion path to reflect this. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata-eh-fw: implement ata_port_schedule_eh() and ata_port_abort()Tejun Heo2006-05-151-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ata_port_schedule_eh() directly schedules EH for @ap without associated qc. Once EH scheduled, no further qc is allowed and EH kicks in as soon as all currently active qc's are drained. ata_port_abort() schedules all currently active commands for EH by qc_completing them with ATA_QCFLAG_FAILED set. If ata_port_abort() doesn't find any qc to abort, it directly schedule EH using ata_port_schedule_eh(). These two functions provide ways to invoke EH for conditions which aren't directly related to any specfic qc. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata: use ATA printk helpersTejun Heo2006-05-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use ATA printk helpers. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata: use dev->apTejun Heo2006-05-151-23/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use dev->ap where possible and eliminate superflous @ap from functions and structures. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata: implement qc->result_tfTejun Heo2006-05-151-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qc->result_tf and ATA_QCFLAG_RESULT_TF. This moves the responsibility of loading result TF from post-compltion path to qc execution path. qc->result_tf is loaded if explicitly requested or the qc failsa. This allows more efficient completion implementation and correct handling of result TF for controllers which don't have global TF representation such as sil3124/32. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | | [PATCH] libata: silly fix in ata_scsi_start_stop_xlat()Tejun Heo2006-05-151-1/+1
| |_|/ / |/| | | | | | | | | | | | | | | | | | | Don't directly access &qc->tf when tf == &qc->tf. Signed-off-by: Tejun Heo <htejun@gmail.com>
* | | | libata: Add helper ata_shost_to_port()Jeff Garzik2006-04-111-4/+4
| | | |
* | | | Merge branch 'master'Jeff Garzik2006-04-111-0/+1
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | Conflicts: drivers/scsi/libata-scsi.c include/linux/libata.h
| * | | [PATCH] move ->eh_strategy_handler to the transport classChristoph Hellwig2006-04-101-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overriding the whole EH code is a per-transport, not per-host thing. Move ->eh_strategy_handler to the transport class, same as ->eh_timed_out. Downside is that scsi_host_alloc can't check for the total lack of EH anymore, but the transition period from old EH where we needed it is long gone already. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: convert ATAPI_ENABLE_DMADIR to module parameterAlbert Lee2006-04-041-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the ATAPI_ENABLE_DMADIR compile time option needed by some SATA-PATA bridge to runtime module parameter. Signed-off-by: Albert Lee <albertcc@tw.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: separate out libata-eh.cTejun Heo2006-04-021-130/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A lot of EH codes are about to be added to libata. Separate out libata-eh.c. ata_scsi_timed_out(), ata_scsi_error(), ata_qc_timeout(), ata_eng_timeout(), ata_eh_qc_complete() and ata_eh_qc_retry() are moved. No code is changed by this patch. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: dec scmd->retries for qcs with zero err_maskTejun Heo2006-04-021-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qcs might get retried because of unrelated failure. e.g. NCQ command failure causes the whole command set to be aborted. Decrement scmd->retries for such retrials to avoid unnecessarily failing commands. Note that scmd->retries will be incremented the first time. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: don't read TF directly from sense generation functionsTejun Heo2006-04-021-18/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TF register might not be directly accessible depending on errors. e.g. TF of failed NCQ command is in log page 10h. Make reading TF responsibility of error handlers. For the current EH, simply push TF reading into qc completion functions as they are practically part of EH. New EH will fill qc->tf with status registers before complting qcs. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: always generate sense if qc->err_mask is non-zeroTejun Heo2006-04-021-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current sense generation code does not generate sense error if status register value doesn't indicate error condition. However, LLDD's may indicate errors which 't show up in status register. Completing such qc's without generating sense results in successful completion of failed commands. Invoke ata_to_sense_error() regardless of status register if qc->err_mask is not zero such that ata_to_sense_error() generates default sense error. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: add ATA_QCFLAG_IOTejun Heo2006-04-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new qc flag ATA_QCFLAG_IO. This flag gets set for normal IO commands originating from SCSI midlayer. This information will be used by EH to determine transfer speed reconfiguration. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: rename ATA_FLAG_PORT_DISABLED to ATA_FLAG_DISABLEDTejun Heo2006-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename ATA_FLAG_PORT_DISABLED to ATA_FLAG_DISABLED for consistency. (ATA_FLAG_* are always about ports). Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
* | | | [PATCH] libata: ATA_FLAG_IN_EH is not used, kill itTejun Heo2006-04-021-13/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Kill unused flag ATA_FLAG_IN_EH. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
OpenPOWER on IntegriCloud