aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/libata-pmp.c
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-05-19 13:17:52 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-14 15:59:32 -0400
commit0a2c0f56159999e20015241d3b8fa89b1ab14309 (patch)
tree2c516452d3b3f85e9a4092b6092160e123d5f5d4 /drivers/ata/libata-pmp.c
parent341c2c958ec7bdd9f54733a8b0b432fe76842a82 (diff)
libata: improve EH retry delay handling
EH retries were delayed by 5 seconds to ensure that resets don't occur back-to-back. However, this 5 second delay is superflous or excessive in many cases. For example, after IDENTIFY times out, there's no reason to wait five more seconds before retrying. This patch adds ehc->last_reset timestamp and record the timestamp for the last reset trial or success and uses it to space resets by ATA_EH_RESET_COOL_DOWN which is 5 secs and removes unconditional 5 sec sleeps. As this change makes inter-try waits often shorter and they're redundant in nature, this patch also removes the "retrying..." messages. While at it, convert explicit rounding up division to DIV_ROUND_UP(). This change speeds up EH in many cases w/o sacrificing robustness. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/libata-pmp.c')
-rw-r--r--drivers/ata/libata-pmp.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 63691d77ac43..b65db309c181 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -727,19 +727,12 @@ static int sata_pmp_eh_recover_pmp(struct ata_port *ap,
727 } 727 }
728 728
729 if (tries) { 729 if (tries) {
730 int sleep = ehc->i.flags & ATA_EHI_DID_RESET;
731
732 /* consecutive revalidation failures? speed down */ 730 /* consecutive revalidation failures? speed down */
733 if (reval_failed) 731 if (reval_failed)
734 sata_down_spd_limit(link); 732 sata_down_spd_limit(link);
735 else 733 else
736 reval_failed = 1; 734 reval_failed = 1;
737 735
738 ata_dev_printk(dev, KERN_WARNING,
739 "retrying reset%s\n",
740 sleep ? " in 5 secs" : "");
741 if (sleep)
742 ssleep(5);
743 ehc->i.action |= ATA_EH_RESET; 736 ehc->i.action |= ATA_EH_RESET;
744 goto retry; 737 goto retry;
745 } else { 738 } else {
@@ -991,10 +984,7 @@ static int sata_pmp_eh_recover(struct ata_port *ap)
991 goto retry; 984 goto retry;
992 985
993 if (--pmp_tries) { 986 if (--pmp_tries) {
994 ata_port_printk(ap, KERN_WARNING,
995 "failed to recover PMP, retrying in 5 secs\n");
996 pmp_ehc->i.action |= ATA_EH_RESET; 987 pmp_ehc->i.action |= ATA_EH_RESET;
997 ssleep(5);
998 goto retry; 988 goto retry;
999 } 989 }
1000 990