]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
libata: implement and use ATA_QCFLAG_QUIET
authorTejun Heo <htejun@gmail.com>
Fri, 26 Oct 2007 07:19:26 +0000 (16:19 +0900)
committerJeff Garzik <jeff@garzik.org>
Tue, 30 Oct 2007 13:59:43 +0000 (09:59 -0400)
Implement ATA_QCFLAG_QUIET which indicates that there's no need to
report if the command fails with AC_ERR_DEV and set it for passthrough
commands.

Combined with previous changes, this now makes device errors for all
direct commands reported directly to the issuer without going through
EH actions and reporting.

Note that EH is still invoked after non-IO device errors to determine
the nature of the error and resume command execution (some controller
requires special care after error to continue).  It just performs
default maintenance after error, examines what's going on, realizes
that it's none of its business and reports the command failure without
logging any error messages.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/ata/libata-eh.c
drivers/ata/libata-scsi.c
include/linux/libata.h

index 3c6ad7d949c128308f2b81888e38b4b70a011b53..8d64f8fd8f1d55a9a322f22112bff1392482302e 100644 (file)
@@ -1878,7 +1878,9 @@ static void ata_eh_link_report(struct ata_link *link)
        for (tag = 0; tag < ATA_MAX_QUEUE; tag++) {
                struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
 
-               if (!(qc->flags & ATA_QCFLAG_FAILED) || qc->dev->link != link)
+               if (!(qc->flags & ATA_QCFLAG_FAILED) || qc->dev->link != link ||
+                   ((qc->flags & ATA_QCFLAG_QUIET) &&
+                    qc->err_mask == AC_ERR_DEV))
                        continue;
                if (qc->flags & ATA_QCFLAG_SENSE_VALID && !qc->err_mask)
                        continue;
index 6ef5ecb917ce36fbcef6a046200cd3ce3a6060fb..fc89590d377265258be05e0d5ff62d95e4aae1d1 100644 (file)
@@ -2767,8 +2767,8 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
         */
        qc->nbytes = scsi_bufflen(scmd);
 
-       /* request result TF */
-       qc->flags |= ATA_QCFLAG_RESULT_TF;
+       /* request result TF and be quiet about device error */
+       qc->flags |= ATA_QCFLAG_RESULT_TF | ATA_QCFLAG_QUIET;
 
        return 0;
 
index 147ccc40c8af0e1bbfd7f75532d14a6e986de52c..1e277852ba42077099f638d09d43bfb8078a7238 100644 (file)
@@ -221,6 +221,7 @@ enum {
        ATA_QCFLAG_IO           = (1 << 3), /* standard IO command */
        ATA_QCFLAG_RESULT_TF    = (1 << 4), /* result TF requested */
        ATA_QCFLAG_CLEAR_EXCL   = (1 << 5), /* clear excl_link on completion */
+       ATA_QCFLAG_QUIET        = (1 << 6), /* don't report device error */
 
        ATA_QCFLAG_FAILED       = (1 << 16), /* cmd failed and is owned by EH */
        ATA_QCFLAG_SENSE_VALID  = (1 << 17), /* sense data valid */