From: Tejun Heo <htejun@gmail.com>
Date: Mon, 16 Jul 2007 05:29:41 +0000 (+0900)
Subject: libata: schedule probing after SError access failure during autopsy
X-Git-Tag: firefly_0821_release~27415^2~1
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4e57c517b3cbaceb7438eeec879ca129fc17442c;p=firefly-linux-kernel-4.4.55.git

libata: schedule probing after SError access failure during autopsy

If SError isn't accessible, EH can't tell whether hotplug has happened
or not.  Report SError read failure with AC_ERR_OTHER and schedule
probing with hardreset.  This will be mainly useful for PMPs.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
---

diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index a5a8f8453061..e7e2ba24ce66 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1478,8 +1478,12 @@ static void ata_eh_autopsy(struct ata_port *ap)
 	if (rc == 0) {
 		ehc->i.serror |= serror;
 		ata_eh_analyze_serror(ap);
-	} else if (rc != -EOPNOTSUPP)
+	} else if (rc != -EOPNOTSUPP) {
+		/* SError read failed, force hardreset and probing */
+		ata_ehi_schedule_probe(&ehc->i);
 		ehc->i.action |= ATA_EH_HARDRESET;
+		ehc->i.err_mask |= AC_ERR_OTHER;
+	}
 
 	/* analyze NCQ failure */
 	ata_eh_analyze_ncq_error(ap);