[U-Boot] [PATCH v4] nios2: convert dma_alloc_coherent to use malloc_cache_aligned

Albert ARIBAUD
2015-10-19T05:52:25Z

Hello Thomas,

On Mon, 12 Oct 2015 20:55:03 +0800, Thomas Chou <thomas@wytron.com.tw>
wrote:
> Hi Marek,
>
> On 10/12/2015 06:32 PM, Marek Vasut wrote:
> > Wouldn't invalidate_dcache_range() be enough here ? You don't care about the
> > data in the newly allocated area at this point I guess -- either you fill them
> > in and then flush, for DMA from CPU to device OR you receive data from device
> > to CPU and then you invalidate this buffer again.
>
> No. We cannot use invalidate cache here. This is related to cache design
> of nios2, kind of direct mapped cache.

Not sure I'm getting this, so for my own education: what prevents from
invalidating the cache, or IOW, what would happen if it was invalidated
at this point rather than flushed?

> Best regards,
> Thomas

Amicalement,
--
Albert.