public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM OMAP: Fix race in OMAP2/3 DMA IRQ handling
@ 2009-01-21 17:24 Juha Yrjölä
  2009-01-22  3:51 ` Shilimkar, Santosh
  0 siblings, 1 reply; 5+ messages in thread
From: Juha Yrjölä @ 2009-01-21 17:24 UTC (permalink / raw)
  To: linux-omap

CSR must be cleared before invoking the callback.

If the callback function starts a new, fast DMA transfer on the same
channel, the completion status might lost if CSR is cleared after
the callback invocation.

Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
---
 arch/arm/plat-omap/dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index 8e6475d..265351b 100755
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -1898,11 +1898,11 @@ static int omap2_dma_handle_ch(int ch)
 		status = dma_read(CSR(ch));
 	}
 
+	dma_write(status, CSR(ch));
+
 	if (likely(dma_chan[ch].callback != NULL))
 		dma_chan[ch].callback(ch, status, dma_chan[ch].data);
 
-	dma_write(status, CSR(ch));
-
 	return 0;
 }
 
-- 
1.5.6.5


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

end of thread, other threads:[~2009-01-23  4:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-21 17:24 [PATCH] ARM OMAP: Fix race in OMAP2/3 DMA IRQ handling Juha Yrjölä
2009-01-22  3:51 ` Shilimkar, Santosh
2009-01-22  8:13   ` Juha Yrjola
2009-01-23  1:27     ` Tony Lindgren
2009-01-23  4:35     ` Shilimkar, Santosh

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