]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dmaengine: rcar-dmac: clear channel register when error
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 3 Jul 2018 00:29:29 +0000 (00:29 +0000)
committerVinod Koul <vkoul@kernel.org>
Mon, 9 Jul 2018 16:52:32 +0000 (22:22 +0530)
We need to clear channel register in error case as recovery.
The channel is already stopped in such case, thus we don't need to call
rcar_dmac_chan_halt() before clearing.

rcar_dmac_chan_halt() will clear and confirm DE bit.
But it will be failed because channel is already stopped in error case.
In other words, we shouldn't call it then.

Reported-by: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Hiroki Negishi <hiroki.negishi.bx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/sh/rcar-dmac.c

index af2f2639cec9ba61d258bc430dc8d0a82ac06d50..9dc73ac92359d65b99ba22837c63548d8b8791d0 100644 (file)
@@ -1522,7 +1522,15 @@ static irqreturn_t rcar_dmac_isr_channel(int irq, void *dev)
 
        chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR);
        if (chcr & RCAR_DMACHCR_CAE) {
-               rcar_dmac_chan_halt(chan);
+               struct rcar_dmac *dmac = to_rcar_dmac(chan->chan.device);
+
+               /*
+                * We don't need to call rcar_dmac_chan_halt()
+                * because channel is already stopped in error case.
+                * We need to clear register and check DE bit as recovery.
+                */
+               rcar_dmac_write(dmac, RCAR_DMACHCLR, 1 << chan->index);
+               rcar_dmac_chcr_de_barrier(chan);
                reinit = true;
                goto spin_lock_end;
        }