aboutsummaryrefslogtreecommitdiff
path: root/drivers/scsi/libata-scsi.c
AgeCommit message (Collapse)Author
2006-06-22[PATCH] libata: Add ata_scsi_dev_disabledBrian King
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>
2006-06-22[libata] Add host lock to struct ata_portJeff Garzik
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>
2006-06-22Merge branch 'master' into upstreamJeff Garzik
Conflicts: drivers/scsi/libata-core.c drivers/scsi/libata-scsi.c include/linux/pci_ids.h
2006-06-12[PATCH] libata: fix oops caused rescanning NULL sdevTejun Heo
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>
2006-06-12[PATCH] Snoop SET FEATURES - WRITE CACHE ENABLE/DISABLE command(v5)zhao, forrest
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>
2006-06-10[SCSI] remove scsi_request infrastructureChristoph Hellwig
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>
2006-06-06[SCSI] fix up request buffer reference in various scsi driversChristoph Hellwig
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>
2006-05-31[PATCH] libata-hp: hook warmplugTejun Heo
Hook transportt->user_scan() and hostt->slave_destroy(). Signed-off-by: Tejun Heo <htejun@gmail.com>
2006-05-31[PATCH] libata-hp: implement warmplugTejun Heo
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>
2006-05-31[PATCH] libata-hp: implement SCSI part of hotplugTejun Heo
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>
2006-05-31[PATCH] libata-hp: implement ata_eh_detach_dev()Tejun Heo
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>
2006-05-31[PATCH] libata-hp-prep: store attached SCSI deviceTejun Heo
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>
2006-05-31[PATCH] libata-hp-prep: use __ata_scsi_find_dev()Tejun Heo
Convert direct sdev -> dev lookup to __ata_scsi_find_dev(). Signed-off-by: Tejun Heo <htejun@gmail.com>
2006-05-31[PATCH] libata-hp-prep: update ata_scsi_find_dev() and friendsTejun Heo
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>
2006-05-24[libata] libata-scsi, sata_mv: trim trailing whitespaceJeff Garzik
2006-05-24[PATCH] libata - fix bracketing and DMA oopsAlan Cox
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>
2006-05-20[PATCH] SCSI: make scsi_implement_eh() generic API for SCSI transportsTejun Heo
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>
2006-05-15Merge branch 'max-sect' into upstreamJeff Garzik
2006-05-15[PATCH] libata-ncq: implement NCQ device configurationTejun Heo
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>
2006-05-15[PATCH] libata-ncq: implement NCQ command translation and exclusionTejun Heo
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>
2006-05-15[PATCH] libata-ncq: pass ata_scsi_translate() return value to SCSI midlayerTejun Heo
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>
2006-05-15[PATCH] libata-eh-fw: update SCSI command completion path for new EHTejun Heo
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>
2006-05-15[PATCH] libata-eh-fw: implement ata_port_schedule_eh() and ata_port_abort()Tejun Heo
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>
2006-05-15[PATCH] libata: use ATA printk helpersTejun Heo
Use ATA printk helpers. Signed-off-by: Tejun Heo <htejun@gmail.com>
2006-05-15[PATCH] libata: use dev->apTejun Heo
Use dev->ap where possible and eliminate superflous @ap from functions and structures. Signed-off-by: Tejun Heo <htejun@gmail.com>
2006-05-15[PATCH] libata: implement qc->result_tfTejun Heo
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>
2006-05-15[PATCH] libata: silly fix in ata_scsi_start_stop_xlat()Tejun Heo
Don't directly access &qc->tf when tf == &qc->tf. Signed-off-by: Tejun Heo <htejun@gmail.com>
2006-04-12Merge branch 'upstream'Jeff Garzik
2006-04-11libata: Add helper ata_shost_to_port()Jeff Garzik
2006-04-11Merge branch 'master'Jeff Garzik
Conflicts: drivers/scsi/libata-scsi.c include/linux/libata.h
2006-04-10[PATCH] move ->eh_strategy_handler to the transport classChristoph Hellwig
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>
2006-04-04[PATCH] libata: convert ATAPI_ENABLE_DMADIR to module parameterAlbert Lee
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>
2006-04-02[PATCH] libata: separate out libata-eh.cTejun Heo
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>
2006-04-02[PATCH] libata: dec scmd->retries for qcs with zero err_maskTejun Heo
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>
2006-04-02[PATCH] libata: don't read TF directly from sense generation functionsTejun Heo
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>
2006-04-02[PATCH] libata: always generate sense if qc->err_mask is non-zeroTejun Heo
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>
2006-04-02[PATCH] libata: add ATA_QCFLAG_IOTejun Heo
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>
2006-04-02[PATCH] libata: rename ATA_FLAG_PORT_DISABLED to ATA_FLAG_DISABLEDTejun Heo
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>
2006-04-02[PATCH] libata: ATA_FLAG_IN_EH is not used, kill itTejun Heo
Kill unused flag ATA_FLAG_IN_EH. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-04-01[PATCH] libata: implement ata_dev_enabled and disabled()Tejun Heo
This patch renames ata_dev_present() to ata_dev_enabled() and adds ata_dev_disabled(). This is to discern the state where a device is present but disabled from not-present state. This disctinction is necessary when configuring transfer mode because device selection timing must not be violated even if a device fails to configure. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-31[PATCH] libata: make ata_qc_issue complete failed qcsTejun Heo
There is no reason for the issuer to diddle with a failed qc as the issuer has complete control over when a qc gets freed (usually in ->complete_fn). Make ata_qc_issue() responsible for completing qcs which failed to issue. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-29Merge branch 'upstream'Jeff Garzik
2006-03-24[PATCH] libata: ata_scsi_ioctl cleanupBrian King
In preparation for SAS, kill some unnecessary code in ata_scsi_ioctl to find the ATA port and device given the scsi_device. Neither local is used in the function. Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-24[PATCH] libata: ata_scsi_queuecmd cleanupBrian King
Encapsulate part of ata_scsi_queuecmd so that it can be reused by future SAS patches. Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-24[libata] export ata_dev_pair; trim trailing whitespaceJeff Garzik
Mostly, trim trailing whitespace. Also: * export ata_dev_pair * move ata_dev_classify export closer to ata_dev_pair export
2006-03-24[PATCH] Make libata not powerdown drivers on PM_EVENT_FREEZE.Nigel Cunningham
At the moment libata doesn't pass pm_message_t down ata_device_suspend. This causes drives to be powered down when we just want a freeze, causing unnecessary wear and tear. This patch gets pm_message_t passed down so that it can be used to determine whether to power down the drive. Signed-off-by: Nigel Cunningham <nigel@suspend2.net> drivers/scsi/libata-core.c | 5 +++-- drivers/scsi/libata-scsi.c | 4 ++-- drivers/scsi/scsi_sysfs.c | 2 +- include/linux/libata.h | 4 ++-- include/scsi/scsi_host.h | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-22Merge branch 'master'Jeff Garzik
2006-03-22[PATCH] libata: increase LBA48 max sectors to 65535Tejun Heo
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>
2006-03-21[PATCH] libata: pick a less confusion "um dunno" errorAlan Cox
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2006-03-21[PATCH] libata: ata_scsi_slave_config cleanupBrian King
Encapsulate some of ata_scsi_slave_config so that parts can be reused in future SAS patches. Signed-off-by: Brian King <brking@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>