]> git.karo-electronics.de Git - mv-sheeva.git/commit
ARM: OMAP: fix DMA vs memory ordering
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 14 Apr 2012 17:57:10 +0000 (18:57 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Mon, 23 Apr 2012 15:54:21 +0000 (16:54 +0100)
commit354535845ffb74d8a4827fbdaa493037d0030eea
treedb21db97f7672f426d21dc8d0097b8b4c38d02fc
parent754aba436bed2051deaa2af7bdda553df056b6fc
ARM: OMAP: fix DMA vs memory ordering

Using coherent DMA memory with the OMAP DMA engine results in
unpredictable behaviour due to memory ordering issues; as things stand,
there is no guarantee that data written to coherent DMA memory will be
visible to the DMA hardware.

This is because the OMAP dma_write() accessor contains no barriers,
necessary on ARMv6 and above.  The effect of this can be seen in comments
in the OMAP serial driver, which incorrectly talks about cache flushing
for the coherent DMA stuff.

Rather than adding barriers to the accessors, add it in the DMA support
code just before we enable DMA, and just after we disable DMA.  This
avoids having barriers for every DMA register access.

Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/plat-omap/dma.c