• Russell King's avatar
    ARM: OMAP: fix DMA vs memory ordering · 35453584
    Russell King authored
    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: default avatarTony Lindgren <tony@atomide.com>
    Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    35453584
dma.c 51.5 KB