aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2006-05-31 18:27:23 +0900
committerTejun Heo <htejun@gmail.com>2006-05-31 18:27:23 +0900
commit20952b699035448d2277c64efc5910a31be66ed1 (patch)
treea2fab9d516ce200ebc8cf72cda214ec447e0d5d9 /drivers
parentef2824073fba9def3cf122e89cc485f66dd71f70 (diff)
downloadlinux-20952b699035448d2277c64efc5910a31be66ed1.tar.gz
[PATCH] libata: set PIO-0 after successful EH reset
Set ata_device->pio_mode to XFER_PIO_0 after a successful reset. This is to keep EH resets consistent with probe resets as updated by the commit b6079ca409bf88c248992e96510dd6f610f7ed89. Note that, with soon-to-follow hotplug update, EH resets will include probe resets. Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/libata-eh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c
index 71b45ad2c1247d..b88f492eab125d 100644
--- a/drivers/scsi/libata-eh.c
+++ b/drivers/scsi/libata-eh.c
@@ -1287,7 +1287,7 @@ static int ata_eh_reset(struct ata_port *ap, ata_reset_fn_t softreset,
unsigned int classes[ATA_MAX_DEVICES];
int tries = ATA_EH_RESET_TRIES;
ata_reset_fn_t reset;
- int rc;
+ int i, rc;
if (softreset && (!hardreset || (!sata_set_spd_needed(ap) &&
!(ehc->i.action & ATA_EH_HARDRESET))))
@@ -1319,6 +1319,12 @@ static int ata_eh_reset(struct ata_port *ap, ata_reset_fn_t softreset,
}
if (rc == 0) {
+ /* After the reset, the device state is PIO 0 and the
+ * controller state is undefined. Record the mode.
+ */
+ for (i = 0; i < ATA_MAX_DEVICES; i++)
+ ap->device[i].pio_mode = XFER_PIO_0;
+
if (postreset)
postreset(ap, classes);