From: Andy Shevchenko Date: Thu, 16 Mar 2017 14:18:44 +0000 (+0200) Subject: dmaengine: cppi41: fix cppi41_dma_tx_status() logic X-Git-Tag: v4.14-rc1~944^2~4^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a08f2673dde1aaba22c79ed016d5901f1b042401;p=platform%2Fkernel%2Flinux-rpi.git dmaengine: cppi41: fix cppi41_dma_tx_status() logic It makes sense to set residue when channel is in progress. Otherwise it should be 0 since transfer is completed. Meanwhile this patch doesn't prevent to set residue value anyway. Signed-off-by: Andy Shevchenko Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c index 675de6a..a583c64 100644 --- a/drivers/dma/cppi41.c +++ b/drivers/dma/cppi41.c @@ -420,11 +420,9 @@ static enum dma_status cppi41_dma_tx_status(struct dma_chan *chan, struct cppi41_channel *c = to_cpp41_chan(chan); enum dma_status ret; - /* lock */ ret = dma_cookie_status(chan, cookie, txstate); - if (txstate && ret == DMA_COMPLETE) - txstate->residue = c->residue; - /* unlock */ + + dma_set_residue(txstate, c->residue); return ret; }