aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2018-07-02 20:29:29 -0400
committerVinod Koul <vkoul@kernel.org>2018-07-09 12:52:32 -0400
commite919417bd6468b7f1b2899200a78f1ad078757d3 (patch)
treee2c2d62ca4cd31bbe5031d798f88a4abebf4117d
parent45c9a603a4dfde06f53446ce1db218958442849b (diff)
dmaengine: rcar-dmac: clear channel register when error
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>
-rw-r--r--drivers/dma/sh/rcar-dmac.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index af2f2639cec9..9dc73ac92359 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1522,7 +1522,15 @@ static irqreturn_t rcar_dmac_isr_channel(int irq, void *dev)
1522 1522
1523 chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR); 1523 chcr = rcar_dmac_chan_read(chan, RCAR_DMACHCR);
1524 if (chcr & RCAR_DMACHCR_CAE) { 1524 if (chcr & RCAR_DMACHCR_CAE) {
1525 rcar_dmac_chan_halt(chan); 1525 struct rcar_dmac *dmac = to_rcar_dmac(chan->chan.device);
1526
1527 /*
1528 * We don't need to call rcar_dmac_chan_halt()
1529 * because channel is already stopped in error case.
1530 * We need to clear register and check DE bit as recovery.
1531 */
1532 rcar_dmac_write(dmac, RCAR_DMACHCLR, 1 << chan->index);
1533 rcar_dmac_chcr_de_barrier(chan);
1526 reinit = true; 1534 reinit = true;
1527 goto spin_lock_end; 1535 goto spin_lock_end;
1528 } 1536 }