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)
committerChristoph Hellwig <hch@lst.de>
Wed, 20 Nov 2019 19:31:41 +0000 (20:31 +0100)
commit68a33b1794665ba8a1d1ef1d3bfcc7c587d380a6
treefa623a6dfd451c161630422aafd0bec2fe486285
parent4268ac6ae5870af10a7417b22990d615f72f77e2
dma-direct: exclude dma_direct_map_resource from the min_low_pfn check

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