[SCSI] hpsa: do not read from controller unnecessarily in completion code
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Tue, 1 May 2012 16:42:30 +0000 (11:42 -0500)
committerJames Bottomley <JBottomley@Parallels.com>
Thu, 10 May 2012 08:11:43 +0000 (09:11 +0100)
MSI/MSI-X interrupts can't race the DMA completion they are communicating
so no need to read from controller to flush the DMA to the host if
MSI or MSI-X interrupts are being used.

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/hpsa.h

index 7b28d54fa878efa075cfaefa6587ecce31bf880f..48f78123d1e6d34158268c6dfdd995b0e2ffc21a 100644 (file)
@@ -258,12 +258,12 @@ static unsigned long SA5_performant_completed(struct ctlr_info *h)
 {
        unsigned long register_value = FIFO_EMPTY;
 
-       /* flush the controller write of the reply queue by reading
-        * outbound doorbell status register.
-        */
-       register_value = readl(h->vaddr + SA5_OUTDB_STATUS);
        /* msi auto clears the interrupt pending bit. */
        if (!(h->msi_vector || h->msix_vector)) {
+               /* flush the controller write of the reply queue by reading
+                * outbound doorbell status register.
+                */
+               register_value = readl(h->vaddr + SA5_OUTDB_STATUS);
                writel(SA5_OUTDB_CLEAR_PERF_BIT, h->vaddr + SA5_OUTDB_CLEAR);
                /* Do a read in order to flush the write to the controller
                 * (as per spec.)