libata: always use ata_qc_complete_multiple() for NCQ command completions
[linux-2.6.git] / drivers / ata / sata_fsl.c
index 7325f77..1440dc0 100644 (file)
@@ -1137,17 +1137,13 @@ static void sata_fsl_host_intr(struct ata_port *ap)
                        ioread32(hcr_base + CE));
 
                for (i = 0; i < SATA_FSL_QUEUE_DEPTH; i++) {
-                       if (done_mask & (1 << i)) {
-                               qc = ata_qc_from_tag(ap, i);
-                               if (qc) {
-                                       ata_qc_complete(qc);
-                               }
+                       if (done_mask & (1 << i))
                                DPRINTK
                                    ("completing ncq cmd,tag=%d,CC=0x%x,CA=0x%x\n",
                                     i, ioread32(hcr_base + CC),
                                     ioread32(hcr_base + CA));
-                       }
                }
+               ata_qc_complete_multiple(ap, ap->qc_active ^ done_mask);
                return;
 
        } else if ((ap->qc_active & (1 << ATA_TAG_INTERNAL))) {