]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
sata_mv: update ata_qc_from_tag
authorMark Lord <liml@rtr.ca>
Fri, 30 Jan 2009 23:49:29 +0000 (18:49 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Wed, 25 Mar 2009 02:02:38 +0000 (22:02 -0400)
Update the logic in ata_qc_from_tag() to match that used
in similar places elsewhere in libata.

Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/sata_mv.c

index 0c25f52249df4f3954335e88bb31c3c42e369efd..181f021274101ccdbd2581c5aab6f42988e8c5a0 100644 (file)
@@ -1628,6 +1628,12 @@ static struct ata_queued_cmd *mv_get_active_qc(struct ata_port *ap)
        if (pp->pp_flags & MV_PP_FLAG_NCQ_EN)
                return NULL;
        qc = ata_qc_from_tag(ap, ap->link.active_tag);
+       if (qc) {
+               if (qc->tf.flags & ATA_TFLAG_POLLING)
+                       qc = NULL;
+               else if (!(qc->flags & ATA_QCFLAG_ACTIVE))
+                       qc = NULL;
+       }
        if (qc && (qc->tf.flags & ATA_TFLAG_POLLING))
                qc = NULL;
        return qc;