dmaengine: sirf: clear pending DMA interrupt when DMA terminates
authorYanchang Li <yl22@csr.com>
Mon, 27 Jul 2015 05:50:21 +0000 (05:50 +0000)
committerVinod Koul <vinod.koul@intel.com>
Tue, 18 Aug 2015 16:43:59 +0000 (22:13 +0530)
If DMA interrupt comes and is latched by IRQ controller during the
execution of dma_terminate_all(), dma_irq routine will be executed
after dma terminated, and it will cause kernel panic.
We clear DMA interrupts in dma_terminate_all() to avoid this useless
interrupt.

Signed-off-by: Yanchang Li <Yanchang.Li@csr.com>
Signed-off-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/sirf-dma.c

index 8c5186cc9f631c23fc4f6639a8f2b00e0ef5aaeb..7d5598d874e18dc3ab31858b2964de69fb029a79 100644 (file)
@@ -455,6 +455,7 @@ static int sirfsoc_dma_terminate_all(struct dma_chan *chan)
        switch (sdma->type) {
        case SIRFSOC_DMA_VER_A7V1:
                writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_INT_EN_CLR);
+               writel_relaxed(1 << cid, sdma->base + SIRFSOC_DMA_CH_INT);
                writel_relaxed((1 << cid) | 1 << (cid + 16),
                               sdma->base +
                               SIRFSOC_DMA_CH_LOOP_CTRL_CLR_ATLAS7);
@@ -462,6 +463,8 @@ static int sirfsoc_dma_terminate_all(struct dma_chan *chan)
                break;
        case SIRFSOC_DMA_VER_A7V2:
                writel_relaxed(0, sdma->base + SIRFSOC_DMA_INT_EN_ATLAS7);
+               writel_relaxed(SIRFSOC_DMA_INT_ALL_ATLAS7,
+                              sdma->base + SIRFSOC_DMA_INT_ATLAS7);
                writel_relaxed(0, sdma->base + SIRFSOC_DMA_LOOP_CTRL_ATLAS7);
                writel_relaxed(0, sdma->base + SIRFSOC_DMA_VALID_ATLAS7);
                break;