Skip to content

Commit

Permalink
ARM: OMAP: Fix race in OMAP2/3 DMA IRQ handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Juha Yrjola authored and Tony Lindgren committed Jan 29, 2009
1 parent 0615115 commit 320ce6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/plat-omap/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 320ce6f

Please sign in to comment.