[PATCH] OMAP: fix DMA vs memory ordering

Santosh Shilimkar santosh.shilimkar at ti.com
Mon Apr 16 00:27:44 EDT 2012


On Saturday 14 April 2012 06:54 PM, Russell King - ARM Linux wrote:
> 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.
> 
> Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
> ---
I don't why the synchronisation in dma_[start/stop] was
missing. The patch indeed make complete sense.



> Is this why no one uses DMA with the serial driver?
>
Will check if this patch helps in some of the DMA issues
seen in serial driver.

Regards
Santosh



More information about the linux-arm-kernel mailing list