public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] dmaengine: at_hdmac: set residue as total len in atc_tx_status
@ 2011-05-04 18:14 Nicolas Ferre
  2011-05-04 18:14 ` [PATCH 2/2] dmaengine: at_hdmac: implement pause and resume in atc_control Nicolas Ferre
  2011-05-06 17:56 ` [PATCH v2 1/3] dmaengine: at_hdmac: set residue as total len in atc_tx_status Nicolas Ferre
  0 siblings, 2 replies; 13+ messages in thread
From: Nicolas Ferre @ 2011-05-04 18:14 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, linux-arm-kernel; +Cc: linux-kernel, Nicolas Ferre

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>
---
 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 f52c9e3..ba0b5ec 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -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);
-- 
1.7.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-05-12  9:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-04 18:14 [PATCH 1/2] dmaengine: at_hdmac: set residue as total len in atc_tx_status Nicolas Ferre
2011-05-04 18:14 ` [PATCH 2/2] dmaengine: at_hdmac: implement pause and resume in atc_control Nicolas Ferre
2011-05-07 18:05   ` Linus Walleij
2011-05-06 17:56 ` [PATCH v2 1/3] dmaengine: at_hdmac: set residue as total len in atc_tx_status Nicolas Ferre
2011-05-06 17:56   ` [PATCH v2 2/3] dmaengine: at_hdmac: implement pause and resume in atc_control Nicolas Ferre
2011-05-06 16:56     ` Nicolas Ferre
2011-05-09 16:11     ` [PATCH] dmaengine: at_hdmac: pause: no need to wait for FIFO empty Nicolas Ferre
2011-05-10 11:56       ` Sergei Shtylyov
2011-05-10 12:05         ` Nicolas Ferre
2011-05-11 16:53           ` Koul, Vinod
2011-05-12  8:28       ` Koul, Vinod
2011-05-12  9:20         ` Nicolas Ferre
2011-05-06 17:56   ` [PATCH v2 3/3] dmaengine: at_hdmac: use descriptor chaining help function Nicolas Ferre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox