aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-eh.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-10-26 03:12:41 -0400
committerJeff Garzik <jeff@garzik.org>2007-10-30 09:59:42 -0400
commitf90f0828e57e97cb1ff19520d252882cfc6fb3c0 (patch)
tree14e67383982020fa1eba40af22d202e5ec04a77b /drivers/ata/libata-eh.c
parentb666da35d900c26cbea1caa465649e2e0afa406c (diff)
libata: stop being overjealous about non-IO commands
libata EH always revalidated device and retried failed command after error except for ATAPI CCs. This is unnecessary and hinders with users issuing direct commands. This patch makes the following changes. * Make sata_sil24 not request ATA_EH_REVALIDATE on device errors. sil24 is the only driver which does this. All others let libata EH core code decide. * Don't request revalidation after device error of non-IO command. Revalidation doesn't really help anybody. As ATA_EH_REVALIDATE isn't set by default, there's no reason to clear it after sense data is read. Kill ATA_EH_REVALIDATE clearing code while at it. * Don't retry non-IO command after device error. Device has rejected the command. There's no point in retrying. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r--drivers/ata/libata-eh.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index fefea7470e51..3c6ad7d949c1 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1800,10 +1800,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
1800 qc->err_mask &= ~AC_ERR_OTHER; 1800 qc->err_mask &= ~AC_ERR_OTHER;
1801 1801
1802 /* SENSE_VALID trumps dev/unknown error and revalidation */ 1802 /* SENSE_VALID trumps dev/unknown error and revalidation */
1803 if (qc->flags & ATA_QCFLAG_SENSE_VALID) { 1803 if (qc->flags & ATA_QCFLAG_SENSE_VALID)
1804 qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER); 1804 qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER);
1805 ehc->i.action &= ~ATA_EH_REVALIDATE;
1806 }
1807 1805
1808 /* accumulate error info */ 1806 /* accumulate error info */
1809 ehc->i.dev = qc->dev; 1807 ehc->i.dev = qc->dev;
@@ -1816,7 +1814,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
1816 if (ap->pflags & ATA_PFLAG_FROZEN || 1814 if (ap->pflags & ATA_PFLAG_FROZEN ||
1817 all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT)) 1815 all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT))
1818 ehc->i.action |= ATA_EH_SOFTRESET; 1816 ehc->i.action |= ATA_EH_SOFTRESET;
1819 else if (all_err_mask) 1817 else if ((is_io && all_err_mask) ||
1818 (!is_io && (all_err_mask & ~AC_ERR_DEV)))
1820 ehc->i.action |= ATA_EH_REVALIDATE; 1819 ehc->i.action |= ATA_EH_REVALIDATE;
1821 1820
1822 /* if we have offending qcs and the associated failed device */ 1821 /* if we have offending qcs and the associated failed device */
@@ -2697,8 +2696,15 @@ void ata_eh_finish(struct ata_port *ap)
2697 /* FIXME: Once EH migration is complete, 2696 /* FIXME: Once EH migration is complete,
2698 * generate sense data in this function, 2697 * generate sense data in this function,
2699 * considering both err_mask and tf. 2698 * considering both err_mask and tf.
2699 *
2700 * There's no point in retrying invalid
2701 * (detected by libata) and non-IO device
2702 * errors (rejected by device). Finish them
2703 * immediately.
2700 */ 2704 */
2701 if (qc->err_mask & AC_ERR_INVALID) 2705 if ((qc->err_mask & AC_ERR_INVALID) ||
2706 (!(qc->flags & ATA_QCFLAG_IO) &&
2707 qc->err_mask == AC_ERR_DEV))
2702 ata_eh_qc_complete(qc); 2708 ata_eh_qc_complete(qc);
2703 else 2709 else
2704 ata_eh_qc_retry(qc); 2710 ata_eh_qc_retry(qc);