Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dfcc173d71b029eb2b10cf99bb5b4e8749e09799
Commit:     dfcc173d71b029eb2b10cf99bb5b4e8749e09799
Parent:     08cf69d005acda706bc014c61301993758ce9c5f
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 31 10:17:05 2007 +0900
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Sat Nov 3 08:47:26 2007 -0400

    libata: consider errors not associated with commands for speed down
    
    libata EH used to ignore errors not associated with commands when
    determining whether speed down is necessary or not.  This leads to the
    following problems.
    
    * Errors not associated with commands can occur indefinitely without
      libata EH taking corrective actions.
    
    * Upstream link errors don't trigger speed down when PMP is attached
      to it and commands issued to downstream device trigger errors on the
      upstream link.
    
    This patch makes ata_eh_link_autopsy() consider errors not associated
    with command for speed down.
    
    Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-eh.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 7a2e54e..ed8813b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1747,6 +1747,7 @@ static void ata_eh_link_autopsy(struct ata_link *link)
 {
        struct ata_port *ap = link->ap;
        struct ata_eh_context *ehc = &link->eh_context;
+       struct ata_device *dev;
        unsigned int all_err_mask = 0;
        int tag, is_io = 0;
        u32 serror;
@@ -1818,18 +1819,24 @@ static void ata_eh_link_autopsy(struct ata_link *link)
                 (!is_io && (all_err_mask & ~AC_ERR_DEV)))
                ehc->i.action |= ATA_EH_REVALIDATE;
 
-       /* if we have offending qcs and the associated failed device */
+       /* If we have offending qcs and the associated failed device,
+        * perform per-dev EH action only on the offending device.
+        */
        if (ehc->i.dev) {
-               /* speed down */
-               ehc->i.action |= ata_eh_speed_down(ehc->i.dev, is_io,
-                                                  all_err_mask);
-
-               /* perform per-dev EH action only on the offending device */
                ehc->i.dev_action[ehc->i.dev->devno] |=
                        ehc->i.action & ATA_EH_PERDEV_MASK;
                ehc->i.action &= ~ATA_EH_PERDEV_MASK;
        }
 
+       /* consider speeding down */
+       dev = ehc->i.dev;
+       if (!dev && ata_link_max_devices(link) == 1 &&
+           ata_dev_enabled(link->device))
+               dev = link->device;
+
+       if (dev)
+               ehc->i.action |= ata_eh_speed_down(dev, is_io, all_err_mask);
+
        DPRINTK("EXIT\n");
 }
 
-
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