linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoyd@nvidia.com>
To: <will@kernel.org>, <robin.murphy@arm.com>, <joro@8bytes.org>,
	<nicolinc@nvidia.com>
Cc: <jgg@ziepe.ca>, <linux-arm-kernel@lists.infradead.org>,
	<iommu@lists.linux.dev>, <linux-kernel@vger.kernel.org>,
	Nirmoy Das <nirmoyd@nvidia.com>
Subject: [RFC PATCH] iommu/arm-smmu-v3: Allow stream ID sharing for devices behind PCIe-to-PCI bridges
Date: Thu, 11 Dec 2025 05:39:33 -0800	[thread overview]
Message-ID: <20251211133933.4128100-1-nirmoyd@nvidia.com> (raw)

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



             reply	other threads:[~2025-12-11 13:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 13:39 Nirmoy Das [this message]
2025-12-12  6:40 ` [RFC PATCH] iommu/arm-smmu-v3: Allow stream ID sharing for devices behind PCIe-to-PCI bridges Jason Gunthorpe
2025-12-12 10:46   ` Robin Murphy
2025-12-12 12:40     ` Nirmoy Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251211133933.4128100-1-nirmoyd@nvidia.com \
    --to=nirmoyd@nvidia.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@ziepe.ca \
    --cc=joro@8bytes.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolinc@nvidia.com \
    --cc=robin.murphy@arm.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).