summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-01-29 20:31:29 +0900
committerGreg Kroah-Hartman <gregkh@suse.de>2009-02-17 09:29:03 -0800
commit1d40aaebcbcac89b609841425eb0018488dc24fe (patch)
tree8ff7fee448de07acf97d5da463c82fbef60a6f65
parentaac6302fdc26d37d77ca7b01ef0976d6cf1d5e5f (diff)
downloadlinux-stable-1d40aaebcbcac89b609841425eb0018488dc24fe.tar.gz
linux-stable-1d40aaebcbcac89b609841425eb0018488dc24fe.tar.bz2
linux-stable-1d40aaebcbcac89b609841425eb0018488dc24fe.zip
libata: fix EH device failure handling
commit d89293abd95bfd7dd9229087d6c30c1464c5ac83 upstream. The dev->pio_mode > XFER_PIO_0 test is there to avoid unnecessary speed down warning messages but it accidentally disabled SATA link spd down during configuration phase after reset where PIO mode is always zero. This patch fixes the problem by moving the test where it belongs. This makes libata probing sequence behave better when the connection is flaky at higher link speeds which isn't too uncommon for eSATA devices. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Cc: Chuck Ebbert <cebbert@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/ata/libata-eh.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 32da9a93ce44..4de18d0c60bc 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2959,12 +2959,13 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)
/* give it just one more chance */
ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
case -EIO:
- if (ehc->tries[dev->devno] == 1 && dev->pio_mode > XFER_PIO_0) {
+ if (ehc->tries[dev->devno] == 1) {
/* This is the last chance, better to slow
* down than lose it.
*/
sata_down_spd_limit(ata_dev_phys_link(dev));
- ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
+ if (dev->pio_mode > XFER_PIO_0)
+ ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
}
}