Thread (3 messages) 3 messages, 1 author, 2019-04-01

[v2,1/2] dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid

From: Dirk Behme <hidden>
Date: 2019-03-05 05:56:37
Also in: linux-renesas-soc, stable
Subsystem: dma generic offload engine subsystem, the rest · Maintainers: Vinod Koul, Linus Torvalds

Having a cyclic DMA, a residue 0 is not an indication of a completed
DMA. In case of cyclic DMA make sure that dma_set_residue() is called
and with this a residue of 0 is forwarded correctly to the caller.

Fixes: 3544d2878817 ("dmaengine: rcar-dmac: use result of updated get_residue in tx_status")
Signed-off-by: Dirk Behme <redacted>
Signed-off-by: Achim Dahlhoff <redacted>
Signed-off-by: Hiroyuki Yokoyama <redacted>
Cc: <redacted> # v4.8+
---
Note: Patch done against mainline v5.0

Changes in v2: None

 drivers/dma/sh/rcar-dmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 2b4f25698169..2ea59229d7f5 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1378,7 +1378,7 @@ static enum dma_status rcar_dmac_tx_status(struct dma_chan *chan,
 	spin_unlock_irqrestore(&rchan->lock, flags);
 
 	/* if there's no residue, the cookie is complete */
-	if (!residue)
+	if (!residue && !rchan->desc.running->cyclic)
 		return DMA_COMPLETE;
 
 	dma_set_residue(txstate, residue);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help