Skip to contentSkip to conversation

dmaengine: at_hdmac: remove clear-on-read in atc_dostart()

PATCH New Nicolas Ferre 2 participants 3 messages Apr 16, 2012 – Apr 20, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: at_hdmac: remove clear-on-read in atc_dostart()

This loop on EBCISR register was designed to clear IRQ sources before enabling a DMA channel. This register is clear-on-read so a race condition can appear if another channel is already active and has just finished its transfer. Removing this read on EBCISR is fixing the issue as there is no case where an IRQ could be pending: we already make sure that this register is drained at probe() time and during resume.

---
 drivers/dma/at_hdmac.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/dma/at_hdmac.c +0 -4
index 7aa58d2..445fdf8 100644
@@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
 
 	vdbg_dump_regs(atchan);
 
-	/* clear any pending interrupt */
-	while (dma_readl(atdma, EBCISR))
-		cpu_relax();
-
 	channel_writel(atchan, SADDR, 0);
 	channel_writel(atchan, DADDR, 0);
 	channel_writel(atchan, CTRLA, 0);
Signature · 1 line
1.7.10
#1 lore raw

PATCH 1/1 dmaengine: at_hdmac: remove clear-on-read in atc_dostart()

On 04/16/2012 02:46 PM, Nicolas Ferre :

Quoted 9 lines

This loop on EBCISR register was designed to clear IRQ sources before enabling a DMA channel. This register is clear-on-read so a race condition can appear if another channel is already active and has just finished its transfer. Removing this read on EBCISR is fixing the issue as there is no case where an IRQ could be pending: we already make sure that this register is drained at probe() time and during resume.

Vinod,

Could you please take this patch as a fix for 3.4-rc?

Thanks, best regards,

Quoted 19 lines
---
 drivers/dma/at_hdmac.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/dma/at_hdmac.c +0 -4
index 7aa58d2..445fdf8 100644
@@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
 
 	vdbg_dump_regs(atchan);
 
-	/* clear any pending interrupt */
-	while (dma_readl(atdma, EBCISR))
-		cpu_relax();
-
 	channel_writel(atchan, SADDR, 0);
 	channel_writel(atchan, DADDR, 0);
 	channel_writel(atchan, CTRLA, 0);
Signature · 1 line
Nicolas Ferre
#2 lore raw

PATCH 1/1 dmaengine: at_hdmac: remove clear-on-read in atc_dostart()

In reply to Nicolas Ferre
Quoted 9 lines · Nicolas Ferre

This loop on EBCISR register was designed to clear IRQ sources before enabling a DMA channel. This register is clear-on-read so a race condition can appear if another channel is already active and has just finished its transfer. Removing this read on EBCISR is fixing the issue as there is no case where an IRQ could be pending: we already make sure that this register is drained at probe() time and during resume.

Applied thanks.

Quoted 19 lines
---
 drivers/dma/at_hdmac.c |    4 ----
 1 file changed, 4 deletions(-)
drivers/dma/at_hdmac.c +0 -4
index 7aa58d2..445fdf8 100644
@@ -221,10 +221,6 @@ static void atc_dostart(struct at_dma_chan *atchan, struct at_desc *first)
 
 	vdbg_dump_regs(atchan);
 
-	/* clear any pending interrupt */
-	while (dma_readl(atdma, EBCISR))
-		cpu_relax();
-
 	channel_writel(atchan, SADDR, 0);
 	channel_writel(atchan, DADDR, 0);
 	channel_writel(atchan, CTRLA, 0);
Signature · 1 line
~Vinod