[PATCH] dma-pool: Do not allocate pool memory from CMA

Christoph Hellwig hch at lst.de
Wed Jul 8 12:58:02 EDT 2020

On Wed, Jul 08, 2020 at 06:49:39PM +0200, Nicolas Saenz Julienne wrote:
> There is no guarantee to CMA's placement, so allocating a zone specific
> atomic pool from CMA might return memory from a completely different
> memory zone. So stop using it.
> Fixes: c84dc6e68a1d ("dma-pool: add additional coherent pools to map to gfp mask")
> Reported-by: Jeremy Linton <jeremy.linton at arm.com>
> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne at suse.de>
> ---
> An more costly alternative would be adding an option to
> dma_alloc_from_contiguous() so it fails when the allocation doesn't fall
> in a specific zone.

Which seems like the right thing to do.  But then again for 5.8 I think
something less invasive like your patch might be better.  Waiting for
a few more opinions for now.

More information about the linux-rpi-kernel mailing list