libata: fix infinite EH waiting bug
[linux-drm-fsl-dcu.git] / drivers / ata / libata-eh.c
index d8070989a39f5881ab43bbc99b2adcd2ccd453e5..f7582c9c320e029aa916912646ec48f0991c6467 100644 (file)
@@ -336,6 +336,7 @@ void ata_scsi_error(struct Scsi_Host *host)
                        }
                        ata_port_printk(ap, KERN_ERR, "EH pending after %d "
                                        "tries, giving up\n", ATA_EH_MAX_REPEAT);
+                       ap->pflags &= ~ATA_PFLAG_EH_PENDING;
                }
 
                /* this run is complete, make sure EH info is clear */
@@ -1616,7 +1617,7 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
        unsigned long deadline;
        unsigned int action;
        ata_reset_fn_t reset;
-       int i, did_followup_srst, rc;
+       int i, rc;
 
        /* about to reset */
        ata_eh_about_to_do(ap, NULL, ehc->i.action & ATA_EH_RESET_MASK);
@@ -1665,8 +1666,6 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
 
        /* did prereset() screw up?  if so, fix up to avoid oopsing */
        if (!reset) {
-               ata_port_printk(ap, KERN_ERR, "BUG: prereset() requested "
-                               "invalid reset type\n");
                if (softreset)
                        reset = softreset;
                else
@@ -1689,11 +1688,9 @@ static int ata_eh_reset(struct ata_port *ap, int classify,
 
        rc = ata_do_reset(ap, reset, classes, deadline);
 
-       did_followup_srst = 0;
        if (reset == hardreset &&
            ata_eh_followup_srst_needed(rc, classify, classes)) {
                /* okay, let's do follow-up softreset */
-               did_followup_srst = 1;
                reset = softreset;
 
                if (!reset) {