public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma-mapping: reliably inform about DMA support for IOMMU
@ 2024-09-11 10:15 Leon Romanovsky
  2024-09-11 12:54 ` Robin Murphy
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Leon Romanovsky @ 2024-09-11 10:15 UTC (permalink / raw)
  To: Joerg Roedel, Will Deacon, Robin Murphy, Christoph Hellwig,
	Marek Szyprowski
  Cc: Leon Romanovsky, iommu, linux-kernel, Nícolas F. R. A. Prado

From: Leon Romanovsky <leonro@nvidia.com>

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 <nfraprado@collabora.com> #KernelCI
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
 kernel/dma/mapping.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 1a7de37bd643..38d7b3239dbb 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -824,6 +824,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.
-- 
2.46.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-09-12 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-11 10:15 [PATCH] dma-mapping: reliably inform about DMA support for IOMMU Leon Romanovsky
2024-09-11 12:54 ` Robin Murphy
2024-09-11 12:54 ` Nícolas F. R. A. Prado
2024-09-12  7:29 ` Christoph Hellwig
2024-09-12 10:50   ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox