From 340986de702bffd457d5e039dc7d40e5cc32091c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juha=20Yrj=C3=B6l=C3=A4?= Date: Wed, 21 Jan 2009 19:24:09 +0200 Subject: [PATCH] ARM OMAP: Fix race in OMAP2/3 DMA IRQ handling 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 Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 arch/arm/plat-omap/dma.c diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c old mode 100644 new mode 100755 index 922985ef32b..9b697a41d77 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -1889,11 +1889,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; } -- 2.41.1