aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/libata-scsi.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-04-02 05:51:53 -0400
committerJeff Garzik <jeff@garzik.org>2006-04-02 10:09:20 -0400
commit35e86b53b1a38e78ff0d70dae4aeb25f4572e433 (patch)
treeaa182ee897dd7211723b4f73843f1a638df2a5ea /drivers/scsi/libata-scsi.c
parentd69cf37d5387801914bbf5297f070c7d2ee0206f (diff)
[PATCH] libata: dec scmd->retries for qcs with zero err_mask
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>
Diffstat (limited to 'drivers/scsi/libata-scsi.c')
-rw-r--r--drivers/scsi/libata-scsi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c
index 28706521773c..44008150d310 100644
--- a/drivers/scsi/libata-scsi.c
+++ b/drivers/scsi/libata-scsi.c
@@ -831,11 +831,14 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc)
831 * should be retried. To be used from EH. 831 * should be retried. To be used from EH.
832 * 832 *
833 * SCSI midlayer limits the number of retries to scmd->allowed. 833 * SCSI midlayer limits the number of retries to scmd->allowed.
834 * This function might need to adjust scmd->retries for commands 834 * scmd->retries is decremented for commands which get retried
835 * which get retried due to unrelated NCQ failures. 835 * due to unrelated failures (qc->err_mask is zero).
836 */ 836 */
837void ata_eh_qc_retry(struct ata_queued_cmd *qc) 837void ata_eh_qc_retry(struct ata_queued_cmd *qc)
838{ 838{
839 struct scsi_cmnd *scmd = qc->scsicmd;
840 if (!qc->err_mask && scmd->retries)
841 scmd->retries--;
839 __ata_eh_qc_complete(qc); 842 __ata_eh_qc_complete(qc);
840} 843}
841 844