mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] dmaengine/dw_dmac fix: dwc_scan_descriptors must compare first desc address also with llp
@ 2011-03-24  6:02 Viresh Kumar
  2011-03-31  5:44 ` Koul, Vinod
  0 siblings, 1 reply; 2+ messages in thread
From: Viresh Kumar @ 2011-03-24  6:02 UTC (permalink / raw)
  To: vinod.koul, dan.j.williams, linux-kernel, jamie
  Cc: shiraz.hashim, armando.visconti, ajay.khandelwal, amit.goel,
	viresh.linux, Viresh Kumar

dwc_scan_descriptors scans all descriptors from active_list in case transfer is
not completed.  It compares first_desc->lli.llp, and then all childrens of its
tx_list. But it doesn't compare its own address, i.e. first_desc->txd.phys, as
this is what we have initially programmed into the controller register. So this
causes dma to stop and finish a transfer, which was never started. And thus
fail.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/dma/dw_dmac.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index b95e6d3..1bd4803 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -304,6 +304,11 @@ static void dwc_scan_descriptors(struct dw_dma *dw, struct dw_dma_chan *dwc)
 	dev_vdbg(chan2dev(&dwc->chan), "scan_descriptors: llp=0x%x\n", llp);
 
 	list_for_each_entry_safe(desc, _desc, &dwc->active_list, desc_node) {
+		/* check first descriptors addr */
+		if (desc->txd.phys == llp)
+			return;
+
+		/* check first descriptors llp */
 		if (desc->lli.llp == llp)
 			/* This one is currently in progress */
 			return;
-- 
1.7.2.2


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

end of thread, other threads:[~2011-03-31  6:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24  6:02 [PATCH] dmaengine/dw_dmac fix: dwc_scan_descriptors must compare first desc address also with llp Viresh Kumar
2011-03-31  5:44 ` Koul, Vinod

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

all inboxes | Powered by JetHome®