Skip to content

Commit f45cfab

Browse files
rleonChristoph Hellwig
authored andcommitted
dma-mapping: reliably inform about DMA support for IOMMU
If the DMA IOMMU path is going to be used, the appropriate check should return that DMA is supported. Fixes: b5c58b2 ("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]>
1 parent 038eb43 commit f45cfab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

kernel/dma/mapping.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,9 @@ static int dma_supported(struct device *dev, u64 mask)
843843

844844
if (WARN_ON(ops && use_dma_iommu(dev)))
845845
return false;
846+
847+
if (use_dma_iommu(dev))
848+
return true;
846849
/*
847850
* ->dma_supported sets the bypass flag, so we must always call
848851
* into the method here unless the device is truly direct mapped.

0 commit comments

Comments
 (0)