* Setup FIS.
         */
        if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE &&
-           !(qc->flags & ATA_QCFLAG_FAILED)) {
+           !(qc->flags & ATA_QCFLAG_EH)) {
                ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf);
                qc->result_tf.status = (rx_fis + RX_FIS_PIO_SETUP)[15];
        } else
 
         * Setup FIS.
         */
        if (qc->tf.protocol == ATA_PROT_PIO && qc->dma_dir == DMA_FROM_DEVICE &&
-           !(qc->flags & ATA_QCFLAG_FAILED)) {
+           !(qc->flags & ATA_QCFLAG_EH)) {
                ata_tf_from_fis(rx_fis + RX_FIS_PIO_SETUP, &qc->result_tf);
                qc->result_tf.status = (rx_fis + RX_FIS_PIO_SETUP)[15];
 
        struct ata_port *ap = qc->ap;
 
        /* make DMA engine forget about the failed command */
-       if (qc->flags & ATA_QCFLAG_FAILED)
+       if (qc->flags & ATA_QCFLAG_EH)
                ahci_kick_engine(ap);
 }
 
 
                ap->ops->post_internal_cmd(qc);
 
        /* perform minimal error analysis */
-       if (qc->flags & ATA_QCFLAG_FAILED) {
+       if (qc->flags & ATA_QCFLAG_EH) {
                if (qc->result_tf.status & (ATA_ERR | ATA_DF))
                        qc->err_mask |= AC_ERR_DEV;
 
        /* XXX: New EH and old EH use different mechanisms to
         * synchronize EH with regular execution path.
         *
-        * In new EH, a failed qc is marked with ATA_QCFLAG_FAILED.
+        * In new EH, a qc owned by EH is marked with ATA_QCFLAG_EH.
         * Normal execution path is responsible for not accessing a
-        * failed qc.  libata core enforces the rule by returning NULL
-        * from ata_qc_from_tag() for failed qcs.
+        * qc owned by EH.  libata core enforces the rule by returning NULL
+        * from ata_qc_from_tag() for qcs owned by EH.
         *
         * Old EH depends on ata_qc_complete() nullifying completion
         * requests if ATA_QCFLAG_EH_SCHEDULED is set.  Old EH does
                struct ata_eh_info *ehi = &dev->link->eh_info;
 
                if (unlikely(qc->err_mask))
-                       qc->flags |= ATA_QCFLAG_FAILED;
+                       qc->flags |= ATA_QCFLAG_EH;
 
                /*
                 * Finish internal commands without any further processing
                 * Non-internal qc has failed.  Fill the result TF and
                 * summon EH.
                 */
-               if (unlikely(qc->flags & ATA_QCFLAG_FAILED)) {
+               if (unlikely(qc->flags & ATA_QCFLAG_EH)) {
                        fill_result_tf(qc);
                        trace_ata_qc_complete_failed(qc);
                        ata_qc_schedule_eh(qc);
 
         * normal completion, error completion, and SCSI timeout.
         * Both completions can race against SCSI timeout.  When normal
         * completion wins, the qc never reaches EH.  When error
-        * completion wins, the qc has ATA_QCFLAG_FAILED set.
+        * completion wins, the qc has ATA_QCFLAG_EH set.
         *
         * When SCSI timeout wins, things are a bit more complex.
         * Normal or error completion can occur after the timeout but
 
                if (i < ATA_MAX_QUEUE) {
                        /* the scmd has an associated qc */
-                       if (!(qc->flags & ATA_QCFLAG_FAILED)) {
+                       if (!(qc->flags & ATA_QCFLAG_EH)) {
                                /* which hasn't failed yet, timeout */
                                qc->err_mask |= AC_ERR_TIMEOUT;
-                               qc->flags |= ATA_QCFLAG_FAILED;
+                               qc->flags |= ATA_QCFLAG_EH;
                                nr_timedout++;
                        }
                } else {
         * this point but the state of the controller is
         * unknown.  Freeze the port to make sure the IRQ
         * handler doesn't diddle with those qcs.  This must
-        * be done atomically w.r.t. setting QCFLAG_FAILED.
+        * be done atomically w.r.t. setting ATA_QCFLAG_EH.
         */
        if (nr_timedout)
                __ata_port_freeze(ap);
 
        WARN_ON(!ap->ops->error_handler);
 
-       qc->flags |= ATA_QCFLAG_FAILED;
+       qc->flags |= ATA_QCFLAG_EH;
        ata_eh_set_pending(ap, 1);
 
        /* The following will fail if timeout has already expired.
         * ata_scsi_error() takes care of such scmds on EH entry.
-        * Note that ATA_QCFLAG_FAILED is unconditionally set after
+        * Note that ATA_QCFLAG_EH is unconditionally set after
         * this function completes.
         */
        blk_abort_request(scsi_cmd_to_rq(qc->scsicmd));
        /* include internal tag in iteration */
        ata_qc_for_each_with_internal(ap, qc, tag) {
                if (qc && (!link || qc->dev->link == link)) {
-                       qc->flags |= ATA_QCFLAG_FAILED;
+                       qc->flags |= ATA_QCFLAG_EH;
                        ata_qc_complete(qc);
                        nr_aborted++;
                }
        all_err_mask |= ehc->i.err_mask;
 
        ata_qc_for_each_raw(ap, qc, tag) {
-               if (!(qc->flags & ATA_QCFLAG_FAILED) ||
+               if (!(qc->flags & ATA_QCFLAG_EH) ||
                    qc->flags & ATA_QCFLAG_RETRY ||
                    ata_dev_phys_link(qc->dev) != link)
                        continue;
                desc = ehc->i.desc;
 
        ata_qc_for_each_raw(ap, qc, tag) {
-               if (!(qc->flags & ATA_QCFLAG_FAILED) ||
+               if (!(qc->flags & ATA_QCFLAG_EH) ||
                    ata_dev_phys_link(qc->dev) != link ||
                    ((qc->flags & ATA_QCFLAG_QUIET) &&
                     qc->err_mask == AC_ERR_DEV))
                char data_buf[20] = "";
                char cdb_buf[70] = "";
 
-               if (!(qc->flags & ATA_QCFLAG_FAILED) ||
+               if (!(qc->flags & ATA_QCFLAG_EH) ||
                    ata_dev_phys_link(qc->dev) != link || !qc->err_mask)
                        continue;
 
 
        /* retry or finish qcs */
        ata_qc_for_each_raw(ap, qc, tag) {
-               if (!(qc->flags & ATA_QCFLAG_FAILED))
+               if (!(qc->flags & ATA_QCFLAG_EH))
                        continue;
 
                if (qc->err_mask) {
 
 
        /* has LLDD analyzed already? */
        ata_qc_for_each_raw(ap, qc, tag) {
-               if (!(qc->flags & ATA_QCFLAG_FAILED))
+               if (!(qc->flags & ATA_QCFLAG_EH))
                        continue;
 
                if (qc->err_mask)
        }
 
        ata_qc_for_each_raw(ap, qc, tag) {
-               if (!(qc->flags & ATA_QCFLAG_FAILED) ||
+               if (!(qc->flags & ATA_QCFLAG_EH) ||
                    ata_dev_phys_link(qc->dev) != link)
                        continue;
 
 
        unsigned long flags;
 
        qc = __ata_qc_from_tag(ap, ap->link.active_tag);
-       if (qc && !(qc->flags & ATA_QCFLAG_FAILED))
+       if (qc && !(qc->flags & ATA_QCFLAG_EH))
                qc = NULL;
 
        spin_lock_irqsave(ap->lock, flags);
        bool thaw = false;
 
        qc = __ata_qc_from_tag(ap, ap->link.active_tag);
-       if (qc && !(qc->flags & ATA_QCFLAG_FAILED))
+       if (qc && !(qc->flags & ATA_QCFLAG_EH))
                qc = NULL;
 
        /* reset PIO HSM and stop DMA engine */
 
                        trace_seq_printf(p, "QUIET ");
                if (qc_flags & ATA_QCFLAG_RETRY)
                        trace_seq_printf(p, "RETRY ");
-               if (qc_flags & ATA_QCFLAG_FAILED)
+               if (qc_flags & ATA_QCFLAG_EH)
                        trace_seq_printf(p, "FAILED ");
                if (qc_flags & ATA_QCFLAG_SENSE_VALID)
                        trace_seq_printf(p, "SENSE_VALID ");
 
 
 static void sata_fsl_post_internal_cmd(struct ata_queued_cmd *qc)
 {
-       if (qc->flags & ATA_QCFLAG_FAILED)
+       if (qc->flags & ATA_QCFLAG_EH)
                qc->err_mask |= AC_ERR_OTHER;
 
        if (qc->err_mask) {
 
 static void inic_post_internal_cmd(struct ata_queued_cmd *qc)
 {
        /* make DMA engine forget about the failed command */
-       if (qc->flags & ATA_QCFLAG_FAILED)
+       if (qc->flags & ATA_QCFLAG_EH)
                inic_reset_port(inic_port_base(qc->ap));
 }
 
 
        struct ata_port *ap = qc->ap;
 
        /* make DMA engine forget about the failed command */
-       if (qc->flags & ATA_QCFLAG_FAILED)
+       if (qc->flags & ATA_QCFLAG_EH)
                pdc_reset_port(ap);
 }
 
 
        struct ata_port *ap = qc->ap;
 
        /* make DMA engine forget about the failed command */
-       if ((qc->flags & ATA_QCFLAG_FAILED) && sil24_init_port(ap))
+       if ((qc->flags & ATA_QCFLAG_EH) && sil24_init_port(ap))
                ata_eh_freeze_port(ap);
 }
 
 
        struct ata_port *ap = qc->ap;
 
        /* make DMA engine forget about the failed command */
-       if (qc->flags & ATA_QCFLAG_FAILED)
+       if (qc->flags & ATA_QCFLAG_EH)
                pdc_reset_port(ap);
 }
 
 
                                        continue;
 
                                ipr_cmd->done = ipr_sata_eh_done;
-                               if (!(ipr_cmd->qc->flags & ATA_QCFLAG_FAILED)) {
+                               if (!(ipr_cmd->qc->flags & ATA_QCFLAG_EH)) {
                                        ipr_cmd->qc->err_mask |= AC_ERR_TIMEOUT;
-                                       ipr_cmd->qc->flags |= ATA_QCFLAG_FAILED;
+                                       ipr_cmd->qc->flags |= ATA_QCFLAG_EH;
                                }
                        }
                }
 
                } else {
                        link->eh_info.err_mask |= ac_err_mask(dev->sata_dev.fis[2]);
                        if (unlikely(link->eh_info.err_mask))
-                               qc->flags |= ATA_QCFLAG_FAILED;
+                               qc->flags |= ATA_QCFLAG_EH;
                }
        } else {
                ac = sas_to_ata_err(stat);
                                qc->err_mask = ac;
                        } else {
                                link->eh_info.err_mask |= AC_ERR_DEV;
-                               qc->flags |= ATA_QCFLAG_FAILED;
+                               qc->flags |= ATA_QCFLAG_EH;
                        }
 
                        dev->sata_dev.fis[2] = ATA_ERR | ATA_DRDY; /* tf status */
 
 static void sas_ata_post_internal(struct ata_queued_cmd *qc)
 {
-       if (qc->flags & ATA_QCFLAG_FAILED)
+       if (qc->flags & ATA_QCFLAG_EH)
                qc->err_mask |= AC_ERR_OTHER;
 
        if (qc->err_mask) {
 
        /* Internal command, fake a timeout and complete. */
        qc->flags &= ~ATA_QCFLAG_ACTIVE;
-       qc->flags |= ATA_QCFLAG_FAILED;
+       qc->flags |= ATA_QCFLAG_EH;
        qc->err_mask |= AC_ERR_TIMEOUT;
        waiting = qc->private_data;
        complete(waiting);
 
        ATA_QCFLAG_QUIET        = (1 << 6), /* don't report device error */
        ATA_QCFLAG_RETRY        = (1 << 7), /* retry after failure */
 
-       ATA_QCFLAG_FAILED       = (1 << 16), /* cmd failed and is owned by EH */
+       ATA_QCFLAG_EH           = (1 << 16), /* cmd aborted and owned by EH */
        ATA_QCFLAG_SENSE_VALID  = (1 << 17), /* sense data valid */
        ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
 
                return qc;
 
        if ((qc->flags & (ATA_QCFLAG_ACTIVE |
-                         ATA_QCFLAG_FAILED)) == ATA_QCFLAG_ACTIVE)
+                         ATA_QCFLAG_EH)) == ATA_QCFLAG_ACTIVE)
                return qc;
 
        return NULL;