[PATCH 2/8] ARM: Implement read/write for ownership in theARMv6 DMA cache ops
Russell King - ARM Linux
linux at arm.linux.org.uk
Mon May 17 03:43:29 EDT 2010
On Mon, May 17, 2010 at 10:34:36AM +0300, Ronen Shitrit wrote:
> After some more thinking, I think I found the problem...
>
> DMA for receive should operate as follows:
> 1) CPU will map (invalidate) the buffers for the DMA
> 2) DMA will place the buffers and ack the CPU
> 3) The CPU will call unmap which will invalidate the buffers again
>
>
> I can only think of one problematic scenario:
> - After 1 and before 2:
> CPU0 did spec prefetch for address x
> - After 2:
> CPU0 is doing inv: lock int, ldr x,
> str x (addr x is marked dirty with wrong data).
The data has been corrupted at this point; you don't need a second CPU.
> CPU1 at this time doing spec prefetch for x which
> will snoop CPU0 and will cause data corruption... :(
>
> I can assume that if I count on the Soc IO cache coherency support all
> this isn't relevant, right? Or there are some issues hiding with v6 +
> IO coherency?
What "IO cache coherency" ? Are you saying that your SoC has a mode
where the DMA controller can snoop the CPU caches?
More information about the linux-arm-kernel
mailing list