Commit f1545154 authored by Tejun Heo's avatar Tejun Heo Committed by Jeff Garzik

libata: quickly trigger SATA SPD down after debouncing failed

Debouncing failure is a good indicator of basic link problem.  Use
-EPIPE to indicate debouncing failure and make ata_eh_reset() invoke
sata_down_spd_limit() if the error occurs during reset.
Signed-off-by: default avatarTejun Heo <htejun@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 008a7896
...@@ -3267,9 +3267,11 @@ int sata_phy_debounce(struct ata_port *ap, const unsigned long *params, ...@@ -3267,9 +3267,11 @@ int sata_phy_debounce(struct ata_port *ap, const unsigned long *params,
last = cur; last = cur;
last_jiffies = jiffies; last_jiffies = jiffies;
/* check deadline */ /* Check deadline. If debouncing failed, return
* -EPIPE to tell upper layer to lower link speed.
*/
if (time_after(jiffies, deadline)) if (time_after(jiffies, deadline))
return -EBUSY; return -EPIPE;
} }
} }
......
...@@ -1790,7 +1790,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, ...@@ -1790,7 +1790,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
schedule_timeout_uninterruptible(delta); schedule_timeout_uninterruptible(delta);
} }
if (reset == hardreset && if (rc == -EPIPE ||
try == ARRAY_SIZE(ata_eh_reset_timeouts) - 1) try == ARRAY_SIZE(ata_eh_reset_timeouts) - 1)
sata_down_spd_limit(ap); sata_down_spd_limit(ap);
if (hardreset) if (hardreset)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment