From f45cfab28fcd5ac67a38750b6c68316b26d35ac8 Mon Sep 17 00:00:00 2001 From: Leon Romanovsky Date: Wed, 11 Sep 2024 13:15:00 +0300 Subject: dma-mapping: reliably inform about DMA support for IOMMU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the DMA IOMMU path is going to be used, the appropriate check should return that DMA is supported. Fixes: b5c58b2fdc42 ("dma-mapping: direct calls for dma-iommu") Closes: https://lore.kernel.org/all/181e06ff-35a3-434f-b505-672f430bd1cb@notapiano Reported-by: NĂ­colas F. R. A. Prado #KernelCI Signed-off-by: Leon Romanovsky Reviewed-by: Robin Murphy Tested-by: NĂ­colas F. R. A. Prado Signed-off-by: Christoph Hellwig --- kernel/dma/mapping.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'kernel/dma/mapping.c') diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c index 7550b5dc5e55..022d670f8cad 100644 --- a/kernel/dma/mapping.c +++ b/kernel/dma/mapping.c @@ -843,6 +843,9 @@ static int dma_supported(struct device *dev, u64 mask) if (WARN_ON(ops && use_dma_iommu(dev))) return false; + + if (use_dma_iommu(dev)) + return true; /* * ->dma_supported sets the bypass flag, so we must always call * into the method here unless the device is truly direct mapped. -- cgit v1.2.3