summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2025-04-11 17:09:14 +0300
committerWill Deacon <will@kernel.org>2025-04-17 14:42:02 +0300
commit2d00c34d665bc23f5200962dbc4ac1919317036c (patch)
tree6cbaacc86401ddf0ea6afc1133096b39bdd2f757
parentb00d24997a11c10d3e420614f0873b83ce358a34 (diff)
downloadlinux-2d00c34d665bc23f5200962dbc4ac1919317036c.tar.xz
iommu/arm-smmu-v3: Fail aliasing StreamIDs more gracefully
We've never supported StreamID aliasing between devices, and as such they will never have had functioning DMA, but this is not fatal to the SMMU itself. Although aliasing between hard-wired platform device StreamIDs would tend to raise questions about the whole system, in practice it's far more likely to occur relatively innocently due to legacy PCI bridges, where the underlying StreamID mappings are still perfectly reasonable. As such, return a more benign -ENODEV when failing probe for such an unsupported device (and log a more obvious error message), so that it doesn't break the entire SMMU probe now that bus_iommu_probe() runs in the right order and can propagate that error back. The end result is still that the device doesn't get an IOMMU group and probably won't work, same as before. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/39d54e49c8476efc4653e352150d44b185d6d50f.1744380554.git.robin.murphy@arm.com Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 0826b6bdf327..48d910399a1b 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -3411,9 +3411,9 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
continue;
dev_warn(master->dev,
- "stream %u already in tree from dev %s\n", sid,
- dev_name(existing_master->dev));
- ret = -EINVAL;
+ "Aliasing StreamID 0x%x (from %s) unsupported, expect DMA to be broken\n",
+ sid, dev_name(existing_master->dev));
+ ret = -ENODEV;
break;
}
}