The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [RFC PATCH] iommu/arm-smmu-v3: Allow stream ID sharing for devices behind PCIe-to-PCI bridges
@ 2025-12-11 13:39 Nirmoy Das
  2025-12-12  6:40 ` Jason Gunthorpe
  0 siblings, 1 reply; 4+ messages in thread
From: Nirmoy Das @ 2025-12-11 13:39 UTC (permalink / raw)
  To: will, robin.murphy, joro, nicolinc
  Cc: jgg, linux-arm-kernel, iommu, linux-kernel, Nirmoy Das

ASPEED BMC controllers have VGA and USB functions behind a PCIe-to-PCI
bridge that causes them to share the same stream ID:

  \-[0005:e0]---00.0-[e1-e2]----00.0-[e2]--+-00.0  ASPEED Graphics Family
                                           \-02.0  ASPEED USB Controller

Both devices get stream ID(0x5e200) due to bridge aliasing. Currently this
USB controller gets rejected with "Aliasing StreamID unsupported", causing
USB timeout errors. Allow stream ID sharing when both devices are on
the same bus behind a PCIe-to-PCI bridge to fix this issue.

Signed-off-by: Nirmoy Das <nirmoyd@nvidia.com>
---
 drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

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 2a8b46b948f05..411b8803eb46f 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -3480,6 +3480,17 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
 			if (existing_master == master)
 				continue;

+			/* Allow PCI devices on the same bus to share stream IDs
+			 * due to PCIe-to-PCI bridge aliasing.
+			 */
+			if (dev_is_pci(master->dev) && dev_is_pci(existing_master->dev)) {
+				struct pci_dev *pdev = to_pci_dev(master->dev);
+				struct pci_dev *existing_pdev = to_pci_dev(existing_master->dev);
+
+				if (pdev->bus == existing_pdev->bus)
+					continue;
+			}
+
 			dev_warn(master->dev,
 				 "Aliasing StreamID 0x%x (from %s) unsupported, expect DMA to be broken\n",
 				 sid, dev_name(existing_master->dev));
--
2.43.0


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

end of thread, other threads:[~2025-12-12 12:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-11 13:39 [RFC PATCH] iommu/arm-smmu-v3: Allow stream ID sharing for devices behind PCIe-to-PCI bridges Nirmoy Das
2025-12-12  6:40 ` Jason Gunthorpe
2025-12-12 10:46   ` Robin Murphy
2025-12-12 12:40     ` Nirmoy Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox