|
@@ -1355,6 +1355,34 @@ static void ata_eh_report(struct ata_port *ap)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static int ata_do_reset(struct ata_port *ap, ata_reset_fn_t reset,
|
|
|
+ unsigned int *classes)
|
|
|
+{
|
|
|
+ int i, rc;
|
|
|
+
|
|
|
+ for (i = 0; i < ATA_MAX_DEVICES; i++)
|
|
|
+ classes[i] = ATA_DEV_UNKNOWN;
|
|
|
+
|
|
|
+ rc = reset(ap, classes);
|
|
|
+ if (rc)
|
|
|
+ return rc;
|
|
|
+
|
|
|
+ /* If any class isn't ATA_DEV_UNKNOWN, consider classification
|
|
|
+ * is complete and convert all ATA_DEV_UNKNOWN to
|
|
|
+ * ATA_DEV_NONE.
|
|
|
+ */
|
|
|
+ for (i = 0; i < ATA_MAX_DEVICES; i++)
|
|
|
+ if (classes[i] != ATA_DEV_UNKNOWN)
|
|
|
+ break;
|
|
|
+
|
|
|
+ if (i < ATA_MAX_DEVICES)
|
|
|
+ for (i = 0; i < ATA_MAX_DEVICES; i++)
|
|
|
+ if (classes[i] == ATA_DEV_UNKNOWN)
|
|
|
+ classes[i] = ATA_DEV_NONE;
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int ata_eh_followup_srst_needed(int rc, int classify,
|
|
|
const unsigned int *classes)
|
|
|
{
|