dma-direct: don't fail on highmem CMA pages in dma_direct_alloc_pages
authorChristoph Hellwig <hch@lst.de>
Sat, 23 Apr 2022 17:20:24 +0000 (19:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:56 +0000 (10:22 +0200)
commit6635e6ba1649ee5f68baf59cc01bf0151d0b4fd8
treee58a5e71d4876d6e59ba6d5b984e785c0b625e6d
parent639518f8e0d303203bf96159d217c33242da8870
dma-direct: don't fail on highmem CMA pages in dma_direct_alloc_pages

[ Upstream commit 92826e967535db2eb117db227b1191aaf98e4bb3 ]

When dma_direct_alloc_pages encounters a highmem page it just gives up
currently.  But what we really should do is to try memory using the
page allocator instead - without this platforms with a global highmem
CMA pool will fail all dma_alloc_pages allocations.

Fixes: efa70f2fdc84 ("dma-mapping: add a new dma_alloc_pages API")
Reported-by: Mark O'Neill <mao@tumblingdice.co.uk>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/dma/direct.c