aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/dw_dmac.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@st.com>2011-04-15 06:33:35 -0400
committerVinod Koul <vinod.koul@intel.com>2011-05-13 10:09:55 -0400
commitabf53902dcc6d44d2e06b09817fa67857aa686fe (patch)
tree0477e3e51d0f392fec140b190aad02045fcdc3a5 /drivers/dma/dw_dmac.c
parent5fedefb87bd0a64281d28edd295f29e3b989d78c (diff)
dmaengine/dw_dmac: set residue as total len in dwc_tx_status if status is !DMA_SUCCESS
If transfer status is !=DMA_SUCCESS, return total transfer len as residue, instead of zero. Signed-off-by: Viresh Kumar <viresh.kumar@st.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw_dmac.c')
-rw-r--r--drivers/dma/dw_dmac.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index 265d43c8b359..f209ff8835e8 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -860,7 +860,11 @@ dwc_tx_status(struct dma_chan *chan,
860 ret = dma_async_is_complete(cookie, last_complete, last_used); 860 ret = dma_async_is_complete(cookie, last_complete, last_used);
861 } 861 }
862 862
863 dma_set_tx_state(txstate, last_complete, last_used, 0); 863 if (ret != DMA_SUCCESS)
864 dma_set_tx_state(txstate, last_complete, last_used,
865 dwc_first_active(dwc)->len);
866 else
867 dma_set_tx_state(txstate, last_complete, last_used, 0);
864 868
865 return ret; 869 return ret;
866} 870}