From: Christoph Hellwig Date: Mon, 14 Feb 2022 08:44:32 +0000 (+0100) Subject: dma-direct: use is_swiotlb_active in dma_direct_map_page X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=07410559f38360885e91cff1b800168681ac515c;p=linux.git dma-direct: use is_swiotlb_active in dma_direct_map_page Use the more specific is_swiotlb_active check instead of checking the global swiotlb_force variable. Signed-off-by: Christoph Hellwig Reviewed-by: Anshuman Khandual Reviewed-by: Konrad Rzeszutek Wilk Tested-by: Boris Ostrovsky --- diff --git a/kernel/dma/direct.h b/kernel/dma/direct.h index 8a6cd53dbe8ce..a78c0ba70645d 100644 --- a/kernel/dma/direct.h +++ b/kernel/dma/direct.h @@ -91,7 +91,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev, return swiotlb_map(dev, phys, size, dir, attrs); if (unlikely(!dma_capable(dev, dma_addr, size, true))) { - if (swiotlb_force != SWIOTLB_NO_FORCE) + if (is_swiotlb_active(dev)) return swiotlb_map(dev, phys, size, dir, attrs); dev_WARN_ONCE(dev, 1,