]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
amd-iommu: handle alias entries correctly in init code
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 2 Jul 2009 10:23:23 +0000 (12:23 +0200)
committerJoerg Roedel <joerg.roedel@amd.com>
Thu, 2 Jul 2009 10:23:23 +0000 (12:23 +0200)
An alias entry in the ACPI table means that the device can send requests to the
IOMMU with both device ids, its own and the alias. This is not handled properly
in the ACPI init code. This patch fixes the issue.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
arch/x86/kernel/amd_iommu_init.c

index 10b2accd12ea5983d917b0646cf445f9c8fe8b93..ec72c7779d6b3d25d53c8c236097815a1b58fe8a 100644 (file)
@@ -691,6 +691,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
 
                        devid = e->devid;
                        devid_to = e->ext >> 8;
+                       set_dev_entry_from_acpi(iommu, devid   , e->flags, 0);
                        set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0);
                        amd_iommu_alias_table[devid] = devid_to;
                        break;
@@ -749,11 +750,13 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu,
 
                        devid = e->devid;
                        for (dev_i = devid_start; dev_i <= devid; ++dev_i) {
-                               if (alias)
+                               if (alias) {
                                        amd_iommu_alias_table[dev_i] = devid_to;
-                               set_dev_entry_from_acpi(iommu,
-                                               amd_iommu_alias_table[dev_i],
-                                               flags, ext_flags);
+                                       set_dev_entry_from_acpi(iommu,
+                                               devid_to, flags, ext_flags);
+                               }
+                               set_dev_entry_from_acpi(iommu, dev_i,
+                                                       flags, ext_flags);
                        }
                        break;
                default: