]> err.no Git - linux-2.6/blobdiff - drivers/ata/libata-eh.c
ata-acpi: don't call _GTF for disabled drive
[linux-2.6] / drivers / ata / libata-eh.c
index 88cdc4938beaca421d66929ce76f03202f399f1c..d94359a24d419cbe36ee09bb155d9a32ef8d81fa 100644 (file)
@@ -2065,7 +2065,7 @@ static int ata_eh_followup_srst_needed(struct ata_link *link,
                                       int rc, int classify,
                                       const unsigned int *classes)
 {
-       if (link->flags & ATA_LFLAG_NO_SRST)
+       if ((link->flags & ATA_LFLAG_NO_SRST) || ata_link_offline(link))
                return 0;
        if (rc == -EAGAIN) {
                if (classify)
@@ -2137,9 +2137,14 @@ int ata_eh_reset(struct ata_link *link, int classify,
        if (hardreset) {
                reset = hardreset;
                ehc->i.action = ATA_EH_HARDRESET;
-       } else {
+       } else if (softreset) {
                reset = softreset;
                ehc->i.action = ATA_EH_SOFTRESET;
+       } else {
+               ata_link_printk(link, KERN_ERR, "BUG: no reset method, "
+                               "please report to linux-ide@vger.kernel.org\n");
+               dump_stack();
+               return -EINVAL;
        }
 
        if (prereset) {