aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <jroedel@suse.de>2019-03-22 11:52:17 -0400
committerJoerg Roedel <jroedel@suse.de>2019-03-25 09:37:00 -0400
commit8bc32a285660e13fdcf92ddaf5b8653abe112040 (patch)
tree600633cad61a75b4c1479218ed8f19fc79a55080
parent8c2ffd9174779014c3fe1f96d9dc3641d9175f00 (diff)
iommu: Don't print warning when IOMMU driver only supports unmanaged domains
Print the warning about the fall-back to IOMMU_DOMAIN_DMA in iommu_group_get_for_dev() only when such a domain was actually allocated. Otherwise the user will get misleading warnings in the kernel log when the iommu driver used doesn't support IOMMU_DOMAIN_DMA and IOMMU_DOMAIN_IDENTITY. Fixes: fccb4e3b8ab09 ('iommu: Allow default domain type to be set on the kernel command line') Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/iommu/iommu.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 33a982e33716..109de67d5d72 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -1105,10 +1105,12 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev)
1105 1105
1106 dom = __iommu_domain_alloc(dev->bus, iommu_def_domain_type); 1106 dom = __iommu_domain_alloc(dev->bus, iommu_def_domain_type);
1107 if (!dom && iommu_def_domain_type != IOMMU_DOMAIN_DMA) { 1107 if (!dom && iommu_def_domain_type != IOMMU_DOMAIN_DMA) {
1108 dev_warn(dev,
1109 "failed to allocate default IOMMU domain of type %u; falling back to IOMMU_DOMAIN_DMA",
1110 iommu_def_domain_type);
1111 dom = __iommu_domain_alloc(dev->bus, IOMMU_DOMAIN_DMA); 1108 dom = __iommu_domain_alloc(dev->bus, IOMMU_DOMAIN_DMA);
1109 if (dom) {
1110 dev_warn(dev,
1111 "failed to allocate default IOMMU domain of type %u; falling back to IOMMU_DOMAIN_DMA",
1112 iommu_def_domain_type);
1113 }
1112 } 1114 }
1113 1115
1114 group->default_domain = dom; 1116 group->default_domain = dom;