Re: [PATCH 4/7] dma-direct: provide generic support for uncached kernel segments

From: Christoph Hellwig
Date: Wed May 01 2019 - 13:29:49 EST

On Wed, May 01, 2019 at 05:18:59PM +0000, Paul Burton wrote:
> I'm not so sure about this part though.
> On MIPS we currently don't clear the allocated memory with memset. Is
> doing that really necessary?

We are clearling it on mips, it is inside dma_direct_alloc_pages.

> If it is necessary then as-is this code will clear the allocated memory
> using uncached writes which will be pretty slow. It would be much more
> efficient to perform the memset before arch_dma_prep_coherent() & before
> converting ret to an uncached address.

Yes, we could do that.