dma-pool: fix coherent pool allocations for IOMMU mappings
authorChristoph Hellwig <hch@lst.de>
Fri, 14 Aug 2020 10:26:24 +0000 (12:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:29:34 +0000 (11:29 +0200)
commit47184b9ddf184cc9a77cf441943a0fe9b7afa575
tree645d5ac3140ae1a9ac586668bba4b24c5ae3e965
parentb960e50d61722b3bb7b7e4157ffafb7586e0ef6a
dma-pool: fix coherent pool allocations for IOMMU mappings

[ Upstream commit 9420139f516d7fbc248ce17f35275cb005ed98ea ]

When allocating coherent pool memory for an IOMMU mapping we don't care
about the DMA mask.  Move the guess for the initial GFP mask into the
dma_direct_alloc_pages and pass dma_coherent_ok as a function pointer
argument so that it doesn't get applied to the IOMMU case.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/dma-iommu.c
include/linux/dma-direct.h
include/linux/dma-mapping.h
kernel/dma/direct.c
kernel/dma/pool.c