diff options
Diffstat (limited to 'drivers/scsi/libata-eh.c')
-rw-r--r-- | drivers/scsi/libata-eh.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/scsi/libata-eh.c b/drivers/scsi/libata-eh.c index 30a83a57a12f..d4b80b64342c 100644 --- a/drivers/scsi/libata-eh.c +++ b/drivers/scsi/libata-eh.c | |||
@@ -1355,6 +1355,34 @@ static void ata_eh_report(struct ata_port *ap) | |||
1355 | } | 1355 | } |
1356 | } | 1356 | } |
1357 | 1357 | ||
1358 | static int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset, | ||
1359 | unsigned int *classes) | ||
1360 | { | ||
1361 | int i, rc; | ||
1362 | |||
1363 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1364 | classes[i] = ATA_DEV_UNKNOWN; | ||
1365 | |||
1366 | rc = reset(ap, classes); | ||
1367 | if (rc) | ||
1368 | return rc; | ||
1369 | |||
1370 | /* If any class isn't ATA_DEV_UNKNOWN, consider classification | ||
1371 | * is complete and convert all ATA_DEV_UNKNOWN to | ||
1372 | * ATA_DEV_NONE. | ||
1373 | */ | ||
1374 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1375 | if (classes[i] != ATA_DEV_UNKNOWN) | ||
1376 | break; | ||
1377 | |||
1378 | if (i < ATA_MAX_DEVICES) | ||
1379 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1380 | if (classes[i] == ATA_DEV_UNKNOWN) | ||
1381 | classes[i] = ATA_DEV_NONE; | ||
1382 | |||
1383 | return 0; | ||
1384 | } | ||
1385 | |||
1358 | static int ata_eh_followup_srst_needed(int rc, int classify, | 1386 | static int ata_eh_followup_srst_needed(int rc, int classify, |
1359 | const unsigned int *classes) | 1387 | const unsigned int *classes) |
1360 | { | 1388 | { |