diff options
author | Dirk Behme <dirk.behme@de.bosch.com> | 2019-01-18 18:11:39 +0900 |
---|---|---|
committer | Ryo Kataoka <ryo.kataoka.wt@renesas.com> | 2019-03-22 20:50:17 +0900 |
commit | 0c7a66e6849d205d4443ee7d8bdd39c43e0e36e1 (patch) | |
tree | beb7348a5eafeb9c031a5849d0604dcb03e80592 | |
parent | 0043eec1e00e4ed5265fca2fb36385c9b184bf75 (diff) | |
download | renesas-bsp-0c7a66e6849d205d4443ee7d8bdd39c43e0e36e1.tar.gz |
dmaengine: sh: rcar-dmac: With cyclic DMA residue 0 is valid
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 <dirk.behme@de.bosch.com>
Signed-off-by: Achim Dahlhoff <Achim.Dahlhoff@de.bosch.com>
Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Cc: <stable@vger.kernel.org> # v4.8+
Link: https://patchwork.kernel.org/patch/10839055/
Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
-rw-r--r-- | drivers/dma/sh/rcar-dmac.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c index 218c5b0e9569d..e3a9c465fc30c 100644 --- a/drivers/dma/sh/rcar-dmac.c +++ b/drivers/dma/sh/rcar-dmac.c @@ -1387,7 +1387,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); |