]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ARM OMAP: Fix race in OMAP2/3 DMA IRQ handling
authorJuha Yrjölä <juha.yrjola@solidboot.com>
Wed, 21 Jan 2009 17:24:09 +0000 (19:24 +0200)
committerTony Lindgren <tony@atomide.com>
Fri, 23 Jan 2009 01:21:33 +0000 (17:21 -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 [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 922985e..9b697a4
@@ -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;
 }