iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/intel-iommu: set as DUMMY_DEVICE_DOMAIN_INFO if no IOMMU
@ 2020-02-03  9:10 Jian-Hong Pan
  2020-02-04  6:11 ` Lu Baolu
  0 siblings, 1 reply; 11+ messages in thread
From: Jian-Hong Pan @ 2020-02-03  9:10 UTC (permalink / raw)
  To: David Woodhouse, Lu Baolu, Joerg Roedel
  Cc: Jian-Hong Pan, iommu, linux, linux-kernel

If the device has no IOMMU, it still invokes iommu_need_mapping during
intel_alloc_coherent. However, iommu_need_mapping can only check the
device is DUMMY_DEVICE_DOMAIN_INFO or not. This patch marks the device
is a DUMMY_DEVICE_DOMAIN_INFO if the device has no IOMMU.

Signed-off-by: Jian-Hong Pan <jian-hong@endlessm.com>
---
 drivers/iommu/intel-iommu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 35a4a3abedc6..878bc986a015 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -5612,8 +5612,10 @@ static int intel_iommu_add_device(struct device *dev)
 	int ret;
 
 	iommu = device_to_iommu(dev, &bus, &devfn);
-	if (!iommu)
+	if (!iommu) {
+		dev->archdata.iommu = DUMMY_DEVICE_DOMAIN_INFO;
 		return -ENODEV;
+	}
 
 	iommu_device_link(&iommu->iommu, dev);
 
-- 
2.25.0

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

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

end of thread, other threads:[~2020-02-11  9:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-03  9:10 [PATCH] iommu/intel-iommu: set as DUMMY_DEVICE_DOMAIN_INFO if no IOMMU Jian-Hong Pan
2020-02-04  6:11 ` Lu Baolu
2020-02-04  9:25   ` Jian-Hong Pan
2020-02-05  1:28     ` Lu Baolu
2020-02-05 10:06       ` Jian-Hong Pan
2020-02-06  7:25         ` Jian-Hong Pan
2020-02-06  7:32           ` Christoph Hellwig
2020-02-06 10:49         ` Lu Baolu
2020-02-07  7:32           ` Jian-Hong Pan
2020-02-08  6:29             ` Lu Baolu
2020-02-11  9:26               ` Daniel Drake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).