Re: [PATCH][RFC] asm-generic:remove calling flush_write_buffers()in dma_sync_*_for_cpu

From: Russell King - ARM Linux
Date: Tue Jul 07 2009 - 13:36:33 EST


On Tue, Jul 07, 2009 at 04:06:48PM +0200, Arnd Bergmann wrote:
> Note that actually you need to do writeback+invalidate in DMA_TO_DEVICE

Rubbish. DMA _to_ the device just needs any data held in the cache to
be pushed out into the hardware RAM. There's absolutely no point in
invalidating it - that's a complete waste of time.

> and at least an invalidate in DMA_FROM_DEVICE during dma_map_*.
> For the unmap, I don't think you ever need to invalidate the cache.

As I've already explained, you do if you have speculative prefetching
which can bring in data into the cache from _any_ memory location at
_any_ time. We _are_ going to have to do this, no questions asked.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/