diff options
author | Nicolas Ferre <nicolas.ferre@atmel.com> | 2011-05-06 13:56:51 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2011-05-09 02:12:45 -0400 |
commit | 543aabc7d295bfe2489f184259395e3467520d48 (patch) | |
tree | dea913d2242b7aa5530616c428d79cfdcd06b6e6 | |
parent | 711b9cea92554be6bd44f04f2485582d762fc441 (diff) |
dmaengine: at_hdmac: set residue as total len in atc_tx_status
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>
-rw-r--r-- | drivers/dma/at_hdmac.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index f52c9e38d889..ba0b5ec4e4c2 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
@@ -1026,7 +1026,12 @@ atc_tx_status(struct dma_chan *chan, | |||
1026 | 1026 | ||
1027 | spin_unlock_bh(&atchan->lock); | 1027 | spin_unlock_bh(&atchan->lock); |
1028 | 1028 | ||
1029 | dma_set_tx_state(txstate, last_complete, last_used, 0); | 1029 | if (ret != DMA_SUCCESS) |
1030 | dma_set_tx_state(txstate, last_complete, last_used, | ||
1031 | atc_first_active(atchan)->len); | ||
1032 | else | ||
1033 | dma_set_tx_state(txstate, last_complete, last_used, 0); | ||
1034 | |||
1030 | dev_vdbg(chan2dev(chan), "tx_status: %d (d%d, u%d)\n", | 1035 | dev_vdbg(chan2dev(chan), "tx_status: %d (d%d, u%d)\n", |
1031 | cookie, last_complete ? last_complete : 0, | 1036 | cookie, last_complete ? last_complete : 0, |
1032 | last_used ? last_used : 0); | 1037 | last_used ? last_used : 0); |