aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-01-29 06:31:29 -0500
committerJeff Garzik <jgarzik@redhat.com>2009-02-02 23:02:57 -0500
commitd89293abd95bfd7dd9229087d6c30c1464c5ac83 (patch)
tree70cc96e6ad14bf6ddbddc5d824e2e104a7387f66 /drivers/ata
parent8d993eaa9c3c61b8a5929a7f695078a1fcfb4869 (diff)
libata: fix EH device failure handling
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>
Diffstat (limited to 'drivers/ata')
-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 8147a8386370..c15572d22a3b 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2979,12 +2979,13 @@ static int ata_eh_handle_dev_fail(struct ata_device *dev, int err)
2979 /* give it just one more chance */ 2979 /* give it just one more chance */
2980 ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1); 2980 ehc->tries[dev->devno] = min(ehc->tries[dev->devno], 1);
2981 case -EIO: 2981 case -EIO:
2982 if (ehc->tries[dev->devno] == 1 && dev->pio_mode > XFER_PIO_0) { 2982 if (ehc->tries[dev->devno] == 1) {
2983 /* This is the last chance, better to slow 2983 /* This is the last chance, better to slow
2984 * down than lose it. 2984 * down than lose it.
2985 */ 2985 */
2986 sata_down_spd_limit(ata_dev_phys_link(dev)); 2986 sata_down_spd_limit(ata_dev_phys_link(dev));
2987 ata_down_xfermask_limit(dev, ATA_DNXFER_PIO); 2987 if (dev->pio_mode > XFER_PIO_0)
2988 ata_down_xfermask_limit(dev, ATA_DNXFER_PIO);
2988 } 2989 }
2989 } 2990 }
2990 2991