diff options
author | Tejun Heo <htejun@gmail.com> | 2008-03-27 06:14:24 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-17 15:44:20 -0400 |
commit | 03faab7827e4e45823fd27c47b84c133e20a0cd0 (patch) | |
tree | 046b04c7e650f5318beb330d70e855a889750154 /drivers/ata/libata-eh.c | |
parent | a5987e0a1b569146ed9cfa0a8c275a21b344fcaa (diff) |
libata: implement ATA_QCFLAG_RETRY
Currently whether a command should be retried after failure is
determined inside ata_eh_finish(). Add ATA_QCFLAG_RETRY and move the
logic into ata_eh_autopsy(). This makes things clearer and helps
extending retry determination logic.
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.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index ec32082356cb..cc8548e1572a 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1785,6 +1785,11 @@ static void ata_eh_link_autopsy(struct ata_link *link) | |||
1785 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) | 1785 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) |
1786 | qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER); | 1786 | qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER); |
1787 | 1787 | ||
1788 | /* determine whether the command is worth retrying */ | ||
1789 | if (!(qc->err_mask & AC_ERR_INVALID) && | ||
1790 | ((qc->flags & ATA_QCFLAG_IO) || qc->err_mask != AC_ERR_DEV)) | ||
1791 | qc->flags |= ATA_QCFLAG_RETRY; | ||
1792 | |||
1788 | /* accumulate error info */ | 1793 | /* accumulate error info */ |
1789 | ehc->i.dev = qc->dev; | 1794 | ehc->i.dev = qc->dev; |
1790 | all_err_mask |= qc->err_mask; | 1795 | all_err_mask |= qc->err_mask; |
@@ -2783,18 +2788,11 @@ void ata_eh_finish(struct ata_port *ap) | |||
2783 | /* FIXME: Once EH migration is complete, | 2788 | /* FIXME: Once EH migration is complete, |
2784 | * generate sense data in this function, | 2789 | * generate sense data in this function, |
2785 | * considering both err_mask and tf. | 2790 | * considering both err_mask and tf. |
2786 | * | ||
2787 | * There's no point in retrying invalid | ||
2788 | * (detected by libata) and non-IO device | ||
2789 | * errors (rejected by device). Finish them | ||
2790 | * immediately. | ||
2791 | */ | 2791 | */ |
2792 | if ((qc->err_mask & AC_ERR_INVALID) || | 2792 | if (qc->flags & ATA_QCFLAG_RETRY) |
2793 | (!(qc->flags & ATA_QCFLAG_IO) && | ||
2794 | qc->err_mask == AC_ERR_DEV)) | ||
2795 | ata_eh_qc_complete(qc); | ||
2796 | else | ||
2797 | ata_eh_qc_retry(qc); | 2793 | ata_eh_qc_retry(qc); |
2794 | else | ||
2795 | ata_eh_qc_complete(qc); | ||
2798 | } else { | 2796 | } else { |
2799 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) { | 2797 | if (qc->flags & ATA_QCFLAG_SENSE_VALID) { |
2800 | ata_eh_qc_complete(qc); | 2798 | ata_eh_qc_complete(qc); |