Skip to content

Commit a0c17ed

Browse files
hegdevasantjoergroedel
authored andcommitted
iommu/amd: Fix alias device DTE setting
Commit 7bea695 restructured DTE flag handling but inadvertently changed the alias device configuration logic. This may cause incorrect DTE settings for certain devices. Add alias flag check before calling set_dev_entry_from_acpi(). Also move the device iteration loop inside the alias check to restrict execution to cases where alias devices are present. Fixes: 7bea695 ("iommu/amd: Introduce struct ivhd_dte_flags to store persistent DTE flags") Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com> Signed-off-by: Vasant Hegde <vasant.hegde@amd.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
1 parent 9ffaf52 commit a0c17ed

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/iommu/amd/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,12 +1455,12 @@ static int __init init_iommu_from_acpi(struct amd_iommu *iommu,
14551455
PCI_FUNC(e->devid));
14561456

14571457
devid = e->devid;
1458-
for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
1459-
if (alias)
1458+
if (alias) {
1459+
for (dev_i = devid_start; dev_i <= devid; ++dev_i)
14601460
pci_seg->alias_table[dev_i] = devid_to;
1461+
set_dev_entry_from_acpi(iommu, devid_to, flags, ext_flags);
14611462
}
14621463
set_dev_entry_from_acpi_range(iommu, devid_start, devid, flags, ext_flags);
1463-
set_dev_entry_from_acpi(iommu, devid_to, flags, ext_flags);
14641464
break;
14651465
case IVHD_DEV_SPECIAL: {
14661466
u8 handle, type;

0 commit comments

Comments
 (0)