]> Git Repo - linux.git/commitdiff
dma-mapping: reliably inform about DMA support for IOMMU
authorLeon Romanovsky <[email protected]>
Wed, 11 Sep 2024 10:15:00 +0000 (13:15 +0300)
committerChristoph Hellwig <[email protected]>
Thu, 12 Sep 2024 07:19:35 +0000 (09:19 +0200)
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 <[email protected]> #KernelCI
Signed-off-by: Leon Romanovsky <[email protected]>
Reviewed-by: Robin Murphy <[email protected]>
Tested-by: NĂ­colas F. R. A. Prado <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
kernel/dma/mapping.c

index 7550b5dc5e55df8fd65d48d41960f11f3fe45077..022d670f8cad296bc270eb02c8edb3e895f40f30 100644 (file)
@@ -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.
This page took 0.058296 seconds and 4 git commands to generate.