]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/libata-eh.c
libata: export ata_eh_analyze_ncq_error
[linux-2.6-omap-h63xx.git] / drivers / ata / libata-eh.c
index 88cdc4938beaca421d66929ce76f03202f399f1c..62e033146bedae50c7de7126f0f3a8b2aec67b17 100644 (file)
@@ -1357,7 +1357,7 @@ static void ata_eh_analyze_serror(struct ata_link *link)
  *     LOCKING:
  *     Kernel thread context (may sleep).
  */
-static void ata_eh_analyze_ncq_error(struct ata_link *link)
+void ata_eh_analyze_ncq_error(struct ata_link *link)
 {
        struct ata_port *ap = link->ap;
        struct ata_eh_context *ehc = &link->eh_context;
@@ -1402,6 +1402,7 @@ static void ata_eh_analyze_ncq_error(struct ata_link *link)
        /* we've got the perpetrator, condemn it */
        qc = __ata_qc_from_tag(ap, tag);
        memcpy(&qc->result_tf, &tf, sizeof(tf));
+       qc->result_tf.flags = ATA_TFLAG_ISADDR | ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
        qc->err_mask |= AC_ERR_DEV | AC_ERR_NCQ;
        ehc->i.err_mask &= ~AC_ERR_DEV;
 }
@@ -2065,7 +2066,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 +2138,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) {