Skip to content

Commit

Permalink
ARM: common: edma: clear completion interrupts on stop
Browse files Browse the repository at this point in the history
When stopping a DMA transfer with interrupts disabled it is possible
that the DMA transfer completes before the events are cleared. In
this case the completion interrupt will be pending, causing a
completion callback after the transfer was stopped.

By clearing the completion interrupt for the stopping channel it is
ensured that no completion event will be generated after the stop.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
John Ogness authored and Greg Kroah-Hartman committed May 6, 2015
1 parent 35a0f95 commit c2d4bb9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/common/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,9 @@ void edma_stop(unsigned channel)
edma_shadow0_write_array(ctlr, SH_SECR, j, mask);
edma_write_array(ctlr, EDMA_EMCR, j, mask);

/* clear possibly pending completion interrupt */
edma_shadow0_write_array(ctlr, SH_ICR, j, mask);

pr_debug("EDMA: EER%d %08x\n", j,
edma_shadow0_read_array(ctlr, SH_EER, j));

Expand Down

0 comments on commit c2d4bb9

Please sign in to comment.