DMA Engine development
 help / color / mirror / Atom feed
* [v3] dmaengine: rcar-dmac: clear channel register when error
@ 2018-07-09 16:52 Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2018-07-09 16:52 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Geert Uytterhoeven, Dan Williams, Magnus Damm, Linux-Renesas,
	Laurent Pinchart, Kieran Bingham, Geert Uytterhoeven, dmaengine,
	Hiroki Negishi

On 03-07-18, 00:29, Kuninori Morimoto wrote:
> 
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> 
> 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.

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [v3] dmaengine: rcar-dmac: clear channel register when error
@ 2018-07-03  0:29 Kuninori Morimoto
  0 siblings, 0 replies; 2+ messages in thread
From: Kuninori Morimoto @ 2018-07-03  0:29 UTC (permalink / raw)
  To: Vinod
  Cc: Geert Uytterhoeven, Dan Williams, Magnus Damm, Linux-Renesas,
	Laurent Pinchart, Kieran Bingham, Geert Uytterhoeven, dmaengine,
	Hiroki Negishi

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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>
---
v2 -> v3

 - use to_rcar_dmac()
 - add Simon's Reviewed-by

 drivers/dma/sh/rcar-dmac.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 279c930..79d14af 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1525,7 +1525,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;
 	}

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-09 16:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-09 16:52 [v3] dmaengine: rcar-dmac: clear channel register when error Vinod Koul
  -- strict thread matches above, loose matches on Subject: below --
2018-07-03  0:29 Kuninori Morimoto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox