Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f90f0828e57e97cb1ff19520d252882cfc6fb3c0
Commit:     f90f0828e57e97cb1ff19520d252882cfc6fb3c0
Parent:     b666da35d900c26cbea1caa465649e2e0afa406c
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 26 16:12:41 2007 +0900
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Oct 30 09:59:42 2007 -0400

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-eh.c  |   16 +++++++++++-----
 drivers/ata/sata_sil24.c |    6 +++---
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index fefea74..3c6ad7d 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)
                        qc->err_mask &= ~AC_ERR_OTHER;
 
                /* SENSE_VALID trumps dev/unknown error and revalidation */
-               if (qc->flags & ATA_QCFLAG_SENSE_VALID) {
+               if (qc->flags & ATA_QCFLAG_SENSE_VALID)
                        qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER);
-                       ehc->i.action &= ~ATA_EH_REVALIDATE;
-               }
 
                /* accumulate error info */
                ehc->i.dev = qc->dev;
@@ -1816,7 +1814,8 @@ static void ata_eh_link_autopsy(struct ata_link *link)
        if (ap->pflags & ATA_PFLAG_FROZEN ||
            all_err_mask & (AC_ERR_HSM | AC_ERR_TIMEOUT))
                ehc->i.action |= ATA_EH_SOFTRESET;
-       else if (all_err_mask)
+       else if ((is_io && all_err_mask) ||
+                (!is_io && (all_err_mask & ~AC_ERR_DEV)))
                ehc->i.action |= ATA_EH_REVALIDATE;
 
        /* if we have offending qcs and the associated failed device */
@@ -2697,8 +2696,15 @@ void ata_eh_finish(struct ata_port *ap)
                        /* FIXME: Once EH migration is complete,
                         * generate sense data in this function,
                         * considering both err_mask and tf.
+                        *
+                        * There's no point in retrying invalid
+                        * (detected by libata) and non-IO device
+                        * errors (rejected by device).  Finish them
+                        * immediately.
                         */
-                       if (qc->err_mask & AC_ERR_INVALID)
+                       if ((qc->err_mask & AC_ERR_INVALID) ||
+                           (!(qc->flags & ATA_QCFLAG_IO) &&
+                            qc->err_mask == AC_ERR_DEV))
                                ata_eh_qc_complete(qc);
                        else
                                ata_eh_qc_retry(qc);
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index 3c481e0..187dcb0 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -265,11 +265,11 @@ static struct sil24_cerr_info {
        unsigned int err_mask, action;
        const char *desc;
 } sil24_cerr_db[] = {
-       [0]                     = { AC_ERR_DEV, ATA_EH_REVALIDATE,
+       [0]                     = { AC_ERR_DEV, 0,
                                    "device error" },
-       [PORT_CERR_DEV]         = { AC_ERR_DEV, ATA_EH_REVALIDATE,
+       [PORT_CERR_DEV]         = { AC_ERR_DEV, 0,
                                    "device error via D2H FIS" },
-       [PORT_CERR_SDB]         = { AC_ERR_DEV, ATA_EH_REVALIDATE,
+       [PORT_CERR_SDB]         = { AC_ERR_DEV, 0,
                                    "device error via SDB FIS" },
        [PORT_CERR_DATA]        = { AC_ERR_ATA_BUS, ATA_EH_SOFTRESET,
                                    "error in data FIS" },
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to