Skip to content

Commit

Permalink
dmaengine: at_hdmac: set residue as total len in atc_tx_status
Browse files Browse the repository at this point in the history
If transfer status is !=DMA_SUCCESS, return total transfer len as residue,
instead of zero.

Idea from dw_dmac patch by Viresh Kumar.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Nicolas Ferre authored and Vinod Koul committed May 9, 2011
1 parent 711b9ce commit 543aabc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/dma/at_hdmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,12 @@ atc_tx_status(struct dma_chan *chan,

spin_unlock_bh(&atchan->lock);

dma_set_tx_state(txstate, last_complete, last_used, 0);
if (ret != DMA_SUCCESS)
dma_set_tx_state(txstate, last_complete, last_used,
atc_first_active(atchan)->len);
else
dma_set_tx_state(txstate, last_complete, last_used, 0);

dev_vdbg(chan2dev(chan), "tx_status: %d (d%d, u%d)\n",
cookie, last_complete ? last_complete : 0,
last_used ? last_used : 0);
Expand Down

0 comments on commit 543aabc

Please sign in to comment.