dmaengine: dw: return immediately from IRQ when DMA isn't in use
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 4 Dec 2015 21:49:24 +0000 (23:49 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 7 Jan 2016 13:11:54 +0000 (14:11 +0100)
There is no need to bother the hardware when all channels are idle. We have not
to get any interrupts.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/dma/dw/core.c

index 7067b6ddc1db6e7662f69bde5715639c479900d8..8b20930ade98149be6b1c831aba2d03a2fc8cf0e 100644 (file)
@@ -622,12 +622,17 @@ static void dw_dma_tasklet(unsigned long data)
 static irqreturn_t dw_dma_interrupt(int irq, void *dev_id)
 {
        struct dw_dma *dw = dev_id;
-       u32 status = dma_readl(dw, STATUS_INT);
+       u32 status;
 
+       /* Check if we have any interrupt from the DMAC which is not in use */
+       if (!dw->in_use)
+               return IRQ_NONE;
+
+       status = dma_readl(dw, STATUS_INT);
        dev_vdbg(dw->dma.dev, "%s: status=0x%x\n", __func__, status);
 
        /* Check if we have any interrupt from the DMAC */
-       if (!status || !dw->in_use)
+       if (!status)
                return IRQ_NONE;
 
        /*