Skip to contentSkip to conversation

dmaengine: dw: fix cyclic transfers

PATCH Superseded Mans Rullgard 2 participants 3 messages Jan 10, 2016 – Jan 11, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: dw: fix cyclic transfers

Commit 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume") moved some channel initialisation to a new function which must be called before starting a transfer.

This adds the necessary dwc_initialize() call to dw_dma_cyclic_start() which was missed in the original commit.

Fixes 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume")

---
Andy, do you want to collect this with your other patches? It's trivial enough that it can go in separately without conflicts too.

---
 drivers/dma/dw/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/dma/dw/core.c +2 -0
index 7067b6ddc1db..2917f75b67b4 100644
@@ -1265,6 +1265,8 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
 		return -EBUSY;
 	}
 
+	dwc_initialize(dwc);
+
 	dma_writel(dw, CLEAR.ERROR, dwc->mask);
 	dma_writel(dw, CLEAR.XFER, dwc->mask);
 
Signature · 1 line
2.7.0
#1 lore raw
Quoted 21 lines · Mans Rullgard

Commit 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume") moved some channel initialisation to a new function which must be called before starting a transfer.

This adds the necessary dwc_initialize() call to dw_dma_cyclic_start() which was missed in the original commit.

Fixes 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume")

---
Andy, do you want to collect this with your other patches? It's trivial enough that it can go in separately without conflicts too.

---
 drivers/dma/dw/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/dma/dw/core.c +0 -0
index 7067b6ddc1db..2917f75b67b4 100644

drivers/dma/dw/core.c int dw_dma_cyclic_start(struct dma_chan *chan) · line 1271

Quoted 7 lines
drivers/dma/dw/core.c +2 -0
@@ -1265,6 +1265,8 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
 		return -EBUSY;
 	}
 
+	dwc_initialize(dwc);
+
 	dma_writel(dw, CLEAR.ERROR, dwc->mask);
 	dma_writel(dw, CLEAR.XFER, dwc->mask);

Ahh, that's a very very old bug :(

Okay, things got cleaned up by putting the dwc_initialize() call within dwc_dostart() and so it worked for all other DMA APIs.

What about calling dwc_dostart() from within dw_dma_cyclic_start()? That will simplify it and remove code duplication issue as well.

Signature · 1 line
viresh
#2 lore raw
Quoted 25 lines · Viresh Kumar
Quoted 24 lines · Mans Rullgard

Commit 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume") moved some channel initialisation to a new function which must be called before starting a transfer.

This adds the necessary dwc_initialize() call to dw_dma_cyclic_start() which was missed in the original commit.

Fixes 61e183f83069 ("dmaengine/dw_dmac: Reconfigure interrupt and chan_cfg register on resume")

---
Andy, do you want to collect this with your other patches? It's trivial enough that it can go in separately without conflicts too.

---
 drivers/dma/dw/core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/dma/dw/core.c +0 -0
index 7067b6ddc1db..2917f75b67b4 100644
@@ -1265,6 +1265,8 @@ int dw_dma_cyclic_start(struct dma_chan *chan)
 		return -EBUSY;
 	}
 
Quoted 6 lines

drivers/dma/dw/core.c int dw_dma_cyclic_start(struct dma_chan *chan) · line 1271

Quoted 4 lines
drivers/dma/dw/core.c +2 -0
+	dwc_initialize(dwc);
+
 	dma_writel(dw, CLEAR.ERROR, dwc->mask);
 	dma_writel(dw, CLEAR.XFER, dwc->mask);

Ahh, that's a very very old bug :(

It's not the only one, I'm afraid.

Quoted 5 lines

Okay, things got cleaned up by putting the dwc_initialize() call within dwc_dostart() and so it worked for all other DMA APIs.

What about calling dwc_dostart() from within dw_dma_cyclic_start()? That will simplify it and remove code duplication issue as well.

Good idea. New patch coming up.

Signature · 1 line
Måns Rullgård