diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-07-02 06:23:23 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-07-02 06:23:23 -0400 |
commit | 7a6a3a086fe60bb3b739f66e47dc5bbc8f530d32 (patch) | |
tree | 689ae6bba73bb5bd23bc5afdcadd9eec89bf44c0 /arch/x86 | |
parent | 6a047d8b9efc4b7d0c57ca4835f7e519e5c90d3f (diff) |
amd-iommu: handle alias entries correctly in init code
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>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 10b2accd12ea..ec72c7779d6b 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -691,6 +691,7 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, | |||
691 | 691 | ||
692 | devid = e->devid; | 692 | devid = e->devid; |
693 | devid_to = e->ext >> 8; | 693 | devid_to = e->ext >> 8; |
694 | set_dev_entry_from_acpi(iommu, devid , e->flags, 0); | ||
694 | set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0); | 695 | set_dev_entry_from_acpi(iommu, devid_to, e->flags, 0); |
695 | amd_iommu_alias_table[devid] = devid_to; | 696 | amd_iommu_alias_table[devid] = devid_to; |
696 | break; | 697 | break; |
@@ -749,11 +750,13 @@ static void __init init_iommu_from_acpi(struct amd_iommu *iommu, | |||
749 | 750 | ||
750 | devid = e->devid; | 751 | devid = e->devid; |
751 | for (dev_i = devid_start; dev_i <= devid; ++dev_i) { | 752 | for (dev_i = devid_start; dev_i <= devid; ++dev_i) { |
752 | if (alias) | 753 | if (alias) { |
753 | amd_iommu_alias_table[dev_i] = devid_to; | 754 | amd_iommu_alias_table[dev_i] = devid_to; |
754 | set_dev_entry_from_acpi(iommu, | 755 | set_dev_entry_from_acpi(iommu, |
755 | amd_iommu_alias_table[dev_i], | 756 | devid_to, flags, ext_flags); |
756 | flags, ext_flags); | 757 | } |
758 | set_dev_entry_from_acpi(iommu, dev_i, | ||
759 | flags, ext_flags); | ||
757 | } | 760 | } |
758 | break; | 761 | break; |
759 | default: | 762 | default: |