Skip to content

Commit

Permalink
dmaengine: cppi41: fix cppi41_dma_tx_status() logic
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Andy Shevchenko authored and Vinod Koul committed Mar 27, 2017
1 parent 4f68b09 commit a08f267
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/dma/cppi41.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a08f267

Please sign in to comment.