Skip to content

Commit f722977

Browse files
hegdevasantgregkh
authored andcommitted
iommu/amd: Fix alias device DTE setting
[ Upstream commit a0c17ed ] 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 <[email protected]> Signed-off-by: Vasant Hegde <[email protected]> Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 34f3a9e commit f722977

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/iommu/amd/init.c

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

14521452
devid = e->devid;
1453-
for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
1454-
if (alias)
1453+
if (alias) {
1454+
for (dev_i = devid_start; dev_i <= devid; ++dev_i)
14551455
pci_seg->alias_table[dev_i] = devid_to;
1456+
set_dev_entry_from_acpi(iommu, devid_to, flags, ext_flags);
14561457
}
14571458
set_dev_entry_from_acpi_range(iommu, devid_start, devid, flags, ext_flags);
1458-
set_dev_entry_from_acpi(iommu, devid_to, flags, ext_flags);
14591459
break;
14601460
case IVHD_DEV_SPECIAL: {
14611461
u8 handle, type;

0 commit comments

Comments
 (0)