diff options
-rw-r--r-- | drivers/scsi/libata-eh.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c index 71b45ad2c124..b88f492eab12 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, | |||
1287 | unsigned int classes[ATA_MAX_DEVICES]; | 1287 | unsigned int classes[ATA_MAX_DEVICES]; |
1288 | int tries = ATA_EH_RESET_TRIES; | 1288 | int tries = ATA_EH_RESET_TRIES; |
1289 | ata_reset_fn_t reset; | 1289 | ata_reset_fn_t reset; |
1290 | int rc; | 1290 | int i, rc; |
1291 | 1291 | ||
1292 | if (softreset && (!hardreset || (!sata_set_spd_needed(ap) && | 1292 | if (softreset && (!hardreset || (!sata_set_spd_needed(ap) && |
1293 | !(ehc->i.action & ATA_EH_HARDRESET)))) | 1293 | !(ehc->i.action & ATA_EH_HARDRESET)))) |
@@ -1319,6 +1319,12 @@ static int ata_eh_reset(struct ata_port *ap, ata_reset_fn_t softreset, | |||
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | if (rc == 0) { | 1321 | if (rc == 0) { |
1322 | /* After the reset, the device state is PIO 0 and the | ||
1323 | * controller state is undefined. Record the mode. | ||
1324 | */ | ||
1325 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1326 | ap->device[i].pio_mode = XFER_PIO_0; | ||
1327 | |||
1322 | if (postreset) | 1328 | if (postreset) |
1323 | postreset(ap, classes); | 1329 | postreset(ap, classes); |
1324 | 1330 | ||