dma-direct: exclude dma_direct_map_resource from the min_low_pfn check
authorChristoph Hellwig <hch@lst.de>
Tue, 19 Nov 2019 16:38:58 +0000 (17:38 +0100)
committerpopcornmix <popcornmix@gmail.com>
Wed, 1 Jul 2020 15:33:26 +0000 (16:33 +0100)
commit7a2497a038b322133b5d0570326a3706ab069588
tree9cd692bb4dd118103e1a8978b4b5c604ba34c980
parent06d6fbbd4ee3e343a8716750c8a80e49bf359ecb
dma-direct: exclude dma_direct_map_resource from the min_low_pfn check

commit 68a33b1794665ba8a1d1ef1d3bfcc7c587d380a6 upstream.

The valid memory address check in dma_capable only makes sense when mapping
normal memory, not when using dma_map_resource to map a device resource.
Add a new boolean argument to dma_capable to exclude that check for the
dma_map_resource case.

Fixes: b12d66278dd6 ("dma-direct: check for overflows on 32 bit DMA addresses")
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
arch/x86/kernel/amd_gart_64.c
drivers/xen/swiotlb-xen.c
include/linux/dma-direct.h
kernel/dma/direct.c
kernel/dma/swiotlb.c