Re: [PATCH V2] net: ethernet: mellanox: correct page conversion

From: David Miller
Date: Mon Apr 18 2016 - 00:01:47 EST


From: Sinan Kaya <okaya@xxxxxxxxxxxxxx>
Date: Sat, 16 Apr 2016 18:23:32 -0400

> Current code is assuming that the address returned by dma_alloc_coherent
> is a logical address. This is not true on ARM/ARM64 systems. This patch
> replaces dma_alloc_coherent with dma_map_page API. The address returned
> can later by virtually mapped from the CPU side with vmap API.
>
> Signed-off-by: Sinan Kaya <okaya@xxxxxxxxxxxxxx>

You can't do this.

The DMA map page API gives non-coherent mappings, and thus requires
proper flushing.

So a straight conversion like this is never legitimate.