Skip to content

Commit 8bc32a2

Browse files
committed
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: fccb4e3 ('iommu: Allow default domain type to be set on the kernel command line') Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 8c2ffd9 commit 8bc32a2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/iommu/iommu.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,10 +1105,12 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev)
11051105

11061106
dom = __iommu_domain_alloc(dev->bus, iommu_def_domain_type);
11071107
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);
11111108
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+
}
11121114
}
11131115

11141116
group->default_domain = dom;

0 commit comments

Comments
 (0)