]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[PATCH] libata: add 5s sleep between resets
authorTejun Heo <htejun@gmail.com>
Sun, 2 Apr 2006 11:55:02 +0000 (20:55 +0900)
committerJeff Garzik <jeff@garzik.org>
Sun, 2 Apr 2006 14:02:57 +0000 (10:02 -0400)
Some devices react badly if resets are performed back-to-back.  Give
devices some time to breath and tell user that we're taking a nap.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/scsi/libata-core.c

index 4fd24075afd2519a0c9fc03e8f8b24e3d1e178fe..3ddfbe1b86c679b9bc8f96914c462f41e28efa4c 100644 (file)
@@ -2582,6 +2582,9 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
                rc = ata_do_reset(ap, softreset, postreset, 0, classes);
                if (rc == 0 && classes[0] != ATA_DEV_UNKNOWN)
                        goto done;
+               printk(KERN_INFO "ata%u: softreset failed, will try "
+                      "hardreset in 5 secs\n", ap->id);
+               ssleep(5);
        }
 
        if (!hardreset)
@@ -2597,10 +2600,20 @@ int ata_drive_probe_reset(struct ata_port *ap, ata_probeinit_fn_t probeinit,
 
                if (ata_down_sata_spd_limit(ap))
                        goto done;
+
+               printk(KERN_INFO "ata%u: hardreset failed, will retry "
+                      "in 5 secs\n", ap->id);
+               ssleep(5);
        }
 
-       if (softreset)
+       if (softreset) {
+               printk(KERN_INFO "ata%u: hardreset succeeded without "
+                      "classification, will retry softreset in 5 secs\n",
+                      ap->id);
+               ssleep(5);
+
                rc = ata_do_reset(ap, softreset, postreset, 0, classes);
+       }
 
  done:
        if (rc == 0 && classes[0] == ATA_DEV_UNKNOWN)