dma-pool: Only allocate from CMA when in same memory zone
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Fri, 14 Aug 2020 10:26:23 +0000 (12:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:34 +0000 (11:29 +0200)
commit1ca28e0d9e49cfc292ed7e4dbe720ceba252e30e
treef5494e07be155667cca768fc054460877b441c35
parent47184b9ddf184cc9a77cf441943a0fe9b7afa575
dma-pool: Only allocate from CMA when in same memory zone

[ Upstream commit d7e673ec2c8e0ea39c4c70fc490d67d7fbda869d ]

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. To get around this double check CMA's placement before
allocating from it.

Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/dma/pool.c