aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-eh.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index c98909ba0b1c..d4dad47b8f17 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2171,18 +2171,12 @@ static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset,
2171} 2171}
2172 2172
2173static int ata_eh_followup_srst_needed(struct ata_link *link, 2173static int ata_eh_followup_srst_needed(struct ata_link *link,
2174 int rc, int classify, 2174 int rc, const unsigned int *classes)
2175 const unsigned int *classes)
2176{ 2175{
2177 if ((link->flags & ATA_LFLAG_NO_SRST) || ata_link_offline(link)) 2176 if ((link->flags & ATA_LFLAG_NO_SRST) || ata_link_offline(link))
2178 return 0; 2177 return 0;
2179 if (rc == -EAGAIN) { 2178 if (rc == -EAGAIN)
2180 if (classify) 2179 return 1;
2181 return 1;
2182 rc = 0;
2183 }
2184 if (rc != 0)
2185 return 0;
2186 if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) 2180 if (sata_pmp_supported(link->ap) && ata_is_host_link(link))
2187 return 1; 2181 return 1;
2188 return 0; 2182 return 0;
@@ -2309,9 +2303,11 @@ int ata_eh_reset(struct ata_link *link, int classify,
2309 ehc->i.flags |= ATA_EHI_DID_SOFTRESET; 2303 ehc->i.flags |= ATA_EHI_DID_SOFTRESET;
2310 2304
2311 rc = ata_do_reset(link, reset, classes, deadline); 2305 rc = ata_do_reset(link, reset, classes, deadline);
2306 if (rc && rc != -EAGAIN)
2307 goto fail;
2312 2308
2313 if (reset == hardreset && 2309 if (reset == hardreset &&
2314 ata_eh_followup_srst_needed(link, rc, classify, classes)) { 2310 ata_eh_followup_srst_needed(link, rc, classes)) {
2315 /* okay, let's do follow-up softreset */ 2311 /* okay, let's do follow-up softreset */
2316 reset = softreset; 2312 reset = softreset;
2317 2313
@@ -2326,10 +2322,6 @@ int ata_eh_reset(struct ata_link *link, int classify,
2326 ata_eh_about_to_do(link, NULL, ATA_EH_RESET); 2322 ata_eh_about_to_do(link, NULL, ATA_EH_RESET);
2327 rc = ata_do_reset(link, reset, classes, deadline); 2323 rc = ata_do_reset(link, reset, classes, deadline);
2328 } 2324 }
2329
2330 /* -EAGAIN can happen if we skipped followup SRST */
2331 if (rc && rc != -EAGAIN)
2332 goto fail;
2333 } else { 2325 } else {
2334 if (verbose) 2326 if (verbose)
2335 ata_link_printk(link, KERN_INFO, "no reset method " 2327 ata_link_printk(link, KERN_INFO, "no reset method "