]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ARM: OMAP: Fix race in OMAP2/3 DMA IRQ handling
authorJuha Yrjola <juha.yrjola@solidboot.com>
Thu, 29 Jan 2009 16:57:12 +0000 (08:57 -0800)
committerTony Lindgren <tony@atomide.com>
Thu, 29 Jan 2009 16:57:12 +0000 (08:57 -0800)
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>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/plat-omap/dma.c

index e77373c39f8c8a3ac76cab7b4f5c336a02ecd947..bec8e363d545fae4fb9bf1dbfa1d33942b702d73 100644 (file)
@@ -1888,11 +1888,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;
 }