Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f1545154a5c96590b1992aac8ee1e2c445e301ed Commit: f1545154a5c96590b1992aac8ee1e2c445e301ed Parent: 008a78961ec72990d09d7625ef9499d7317d040d Author: Tejun Heo <[EMAIL PROTECTED]> AuthorDate: Mon Jul 16 14:29:40 2007 +0900 Committer: Jeff Garzik <[EMAIL PROTECTED]> CommitDate: Fri Jul 20 08:19:06 2007 -0400
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: Tejun Heo <[EMAIL PROTECTED]> Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]> --- drivers/ata/libata-core.c | 6 ++++-- drivers/ata/libata-eh.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index c325b7a..05922e9 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -3267,9 +3267,11 @@ int sata_phy_debounce(struct ata_port *ap, const unsigned long *params, last = cur; 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)) - return -EBUSY; + return -EPIPE; } } diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 183eaf4..1a4397a 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c @@ -1790,7 +1790,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify, schedule_timeout_uninterruptible(delta); } - if (reset == hardreset && + if (rc == -EPIPE || try == ARRAY_SIZE(ata_eh_reset_timeouts) - 1) sata_down_spd_limit(ap); if (hardreset) - 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