All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu/arm-smmu-v3: Fail aliasing StreamIDs more gracefully
@ 2025-04-11 14:09 Robin Murphy
  2025-04-11 15:21 ` Jason Gunthorpe
  2025-04-17 14:27 ` Will Deacon
  0 siblings, 2 replies; 7+ messages in thread
From: Robin Murphy @ 2025-04-11 14:09 UTC (permalink / raw)
  To: joro, will; +Cc: iommu, linux-arm-kernel, jgg, nicolinc

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>
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 4 ++--
 1 file changed, 2 insertions(+), 2 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 b4c21aaed126..c06459f7077b 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -3400,9 +3400,9 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
 		/* Insert into SID tree */
 		if (rb_find_add(&new_stream->node, &smmu->streams,
 				arm_smmu_streams_cmp_node)) {
-			dev_warn(master->dev, "stream %u already in tree\n",
+			dev_warn(master->dev, "Aliasing StreamID 0x%x unsupported, expect DMA to be broken\n",
 				 sid);
-			ret = -EINVAL;
+			ret = -ENODEV;
 			break;
 		}
 	}
-- 
2.39.2.101.g768bb238c484.dirty



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

end of thread, other threads:[~2025-04-17 15:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-11 14:09 [PATCH] iommu/arm-smmu-v3: Fail aliasing StreamIDs more gracefully Robin Murphy
2025-04-11 15:21 ` Jason Gunthorpe
2025-04-11 15:50   ` Pranjal Shrivastava
2025-04-11 15:58     ` Jason Gunthorpe
2025-04-11 18:16   ` Robin Murphy
2025-04-11 18:46     ` Jason Gunthorpe
2025-04-17 14:27 ` Will Deacon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.