• Russell King's avatar
    ARM: dma-mapping: fix for speculative prefetching · 2ffe2da3
    Russell King authored
    ARMv6 and ARMv7 CPUs can perform speculative prefetching, which makes
    DMA cache coherency handling slightly more interesting.  Rather than
    being able to rely upon the CPU not accessing the DMA buffer until DMA
    has completed, we now must expect that the cache could be loaded with
    possibly stale data from the DMA buffer.
    
    Where DMA involves data being transferred to the device, we clean the
    cache before handing it over for DMA, otherwise we invalidate the buffer
    to get rid of potential writebacks.  On DMA Completion, if data was
    transferred from the device, we invalidate the buffer to get rid of
    any stale speculative prefetches.
    Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
    Tested-By: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
    2ffe2da3
cache-v7.S 7.93 KB