Skip to content

Commit 182d9af

Browse files
committed
Merge: iommu/arm-smmu-v3: Backport fix for duplicate stream ID warnings
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6896 JIRA: https://issues.redhat.com/browse/RHEL-89787 iommu/arm-smmu-v3: Backport fix for duplicate stream ID warnings Backport commit b00d249 ("iommu/arm-smmu-v3: Fix iommu_device_probe bug...") to resolve SMMUv3 probe failures caused by duplicate stream IDs in ASPEED PCI topologies. This fixes "stream N already in tree" warnings during device probe and prevents IOMMU configuration errors. Testing on Ampere AltraMax (aarch64) confirmed elimination of duplicate stream ID warnings. Also, no soft lock-ups were observed in AST driver. Signed-off-by: Steve Dunnagan <sdunnaga@redhat.com> Approved-by: Jerry Snitselaar <jsnitsel@redhat.com> Approved-by: Eder Zulian <ezulian@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents 9d23ccd + c3fb161 commit 182d9af

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3364,6 +3364,7 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
33643364
mutex_lock(&smmu->streams_mutex);
33653365
for (i = 0; i < fwspec->num_ids; i++) {
33663366
struct arm_smmu_stream *new_stream = &master->streams[i];
3367+
struct rb_node *existing;
33673368
u32 sid = fwspec->ids[i];
33683369

33693370
new_stream->id = sid;
@@ -3374,10 +3375,20 @@ static int arm_smmu_insert_master(struct arm_smmu_device *smmu,
33743375
break;
33753376

33763377
/* Insert into SID tree */
3377-
if (rb_find_add(&new_stream->node, &smmu->streams,
3378-
arm_smmu_streams_cmp_node)) {
3379-
dev_warn(master->dev, "stream %u already in tree\n",
3380-
sid);
3378+
existing = rb_find_add(&new_stream->node, &smmu->streams,
3379+
arm_smmu_streams_cmp_node);
3380+
if (existing) {
3381+
struct arm_smmu_master *existing_master =
3382+
rb_entry(existing, struct arm_smmu_stream, node)
3383+
->master;
3384+
3385+
/* Bridged PCI devices may end up with duplicated IDs */
3386+
if (existing_master == master)
3387+
continue;
3388+
3389+
dev_warn(master->dev,
3390+
"stream %u already in tree from dev %s\n", sid,
3391+
dev_name(existing_master->dev));
33813392
ret = -EINVAL;
33823393
break;
33833394
}

0 commit comments

Comments
 (0)