diff mbox

[v1,1/2] dmaengine: cppi41: fix cppi41_dma_tx_status() logic

Message ID 20170316141845.83101-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Headers show

Commit Message

Andy Shevchenko March 16, 2017, 2:18 p.m. UTC
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 <andriy.shevchenko@linux.intel.com>
---
- it has not be tested
 drivers/dma/cppi41.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Vinod Koul March 27, 2017, 5:20 a.m. UTC | #1
On Thu, Mar 16, 2017 at 04:18:44PM +0200, Andy Shevchenko wrote:
> 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.

Applied both, Thanks
diff mbox

Patch

diff --git a/drivers/dma/cppi41.c b/drivers/dma/cppi41.c
index 675de6a27e39..a583c644a7bc 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;
 }