If a failed command has a valid autosense there is no need to
retry it on the ATA level; at best we're incurring the same
error again. So rather not retry it here, but leave it to
the SCSI layer to decide if a retry is in order.

Signed-off-by: Hannes Reinecke <h...@suse.de>
---
 drivers/ata/libata-eh.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7465031..1b4e9d1 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2218,6 +2218,8 @@ static inline int ata_eh_worth_retry(struct 
ata_queued_cmd *qc)
                return 1;       /* otherwise retry anything from fs stack */
        if (qc->err_mask & AC_ERR_INVALID)
                return 0;       /* don't retry these */
+       if (qc->flags & ATA_QCFLAG_SENSE_VALID)
+               return 0;       /* Autosense, no need to retry here */
        return qc->err_mask != AC_ERR_DEV;  /* retry if not dev error */
 }
 
-- 
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to