Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb17ef10 authored by Brian Niebuhr's avatar Brian Niebuhr Committed by Kevin Hilman
Browse files

davinci: edma: clear events in edma_start()



This patch fixes an issue where a DMA channel can erroneously process an
event generated by a previous transfer.  A failure case is where DMA is
being used for SPI transmit and receive channels on OMAP L138.  In this
case there is a single bit that controls all event generation from the
SPI peripheral.  Therefore it is possible that between when edma_stop()
has been called for the transmit channel on a previous transfer and
edma_start() is called for the transmit channel on a subsequent transfer,
that a transmit event has been generated.

The fix is to clear events in edma_start().  This prevents false events
from being processed when events are enabled for that channel.

Signed-off-by: default avatarBrian Niebuhr <bniebuhr@efjohnson.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 5eb2e891
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1266,7 +1266,8 @@ int edma_start(unsigned channel)
		/* EDMA channel with event association */
		pr_debug("EDMA: ER%d %08x\n", j,
			edma_shadow0_read_array(ctlr, SH_ER, j));
		/* Clear any pending error */
		/* Clear any pending event or error */
		edma_write_array(ctlr, EDMA_ECR, j, mask);
		edma_write_array(ctlr, EDMA_EMCR, j, mask);
		/* Clear any SER */
		edma_shadow0_write_array(ctlr, SH_SECR, j, mask);