Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b8cffc6ad8c000410186815b7bcc6b76ef1bbb13
Commit:     b8cffc6ad8c000410186815b7bcc6b76ef1bbb13
Parent:     9b89391cc861b8a1105551909eb66c024fe18ab2
Author:     Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 2 16:50:52 2007 +0900
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue May 1 07:49:54 2007 -0400

    libata: improve ata_std_prereset()
    
    This patch updates ata_std_prereset() as follows.
    
    * Don't fail on phy resume failure.  Just whine and continue.  Failure
      from prereset makes libata abort whole reset sequence and give up
      the port, so prereset() should be best effort.  This is more
      important with the coming EH updates as prereset() will be called
      with shorter timeout.
    
    * If ata_wait_ready() fails, whine and request hardreset instead.
    
    Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/ata/libata-core.c |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 49d2667..12717fa 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3338,7 +3338,11 @@ static void ata_wait_spinup(struct ata_port *ap, 
unsigned long deadline)
  *     @ap: ATA port to be reset
  *     @deadline: deadline jiffies for the operation
  *
- *     @ap is about to be reset.  Initialize it.
+ *     @ap is about to be reset.  Initialize it.  Failure from
+ *     prereset makes libata abort whole reset sequence and give up
+ *     that port, so prereset should be best-effort.  It does its
+ *     best to prepare for reset sequence but if things go wrong, it
+ *     should just whine, not fail.
  *
  *     LOCKING:
  *     Kernel thread context (may sleep)
@@ -3368,19 +3372,23 @@ int ata_std_prereset(struct ata_port *ap, unsigned long 
deadline)
        /* if SATA, resume phy */
        if (ap->cbl == ATA_CBL_SATA) {
                rc = sata_phy_resume(ap, timing, deadline);
-               if (rc && rc != -EOPNOTSUPP) {
-                       /* phy resume failed */
+               /* whine about phy resume failure but proceed */
+               if (rc && rc != -EOPNOTSUPP)
                        ata_port_printk(ap, KERN_WARNING, "failed to resume "
                                        "link for reset (errno=%d)\n", rc);
-                       return rc;
-               }
        }
 
        /* Wait for !BSY if the controller can wait for the first D2H
         * Reg FIS and we don't know that no device is attached.
         */
-       if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap))
-               ata_wait_ready(ap, deadline);
+       if (!(ap->flags & ATA_FLAG_SKIP_D2H_BSY) && !ata_port_offline(ap)) {
+               rc = ata_wait_ready(ap, deadline);
+               if (rc) {
+                       ata_port_printk(ap, KERN_WARNING, "device not ready "
+                                       "(errno=%d), forcing hardreset\n", rc);
+                       ehc->i.action |= ATA_EH_HARDRESET;
+               }
+       }
 
        return 0;
 }
-
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