aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/amd_iommu_init.c
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-07-03 13:35:10 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-04 05:44:43 -0400
commitc1cbebeec4a6be1c1fb54fbf2395ade2534b03c4 (patch)
tree33100ac63635f4e29de6a37ba4532d07950f76b1 /arch/x86/kernel/amd_iommu_init.c
parent8b14518fadd9d5915827d86d5c10e602fedf042e (diff)
x86, AMD IOMMU: don't try to init IOMMU if early detect code did not detect one
This patch adds a check if the early detect code has found AMD IOMMU hardware descriptions and does not try to initialize hardware if the check failed. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Cc: iommu@lists.linux-foundation.org Cc: bhavna.sarathy@amd.com Cc: robert.richter@amd.com Cc: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
-rw-r--r--arch/x86/kernel/amd_iommu_init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index c54c82305af..c970fac6fdc 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -101,6 +101,8 @@ struct ivmd_header {
101 u64 range_length; 101 u64 range_length;
102} __attribute__((packed)); 102} __attribute__((packed));
103 103
104static int __initdata amd_iommu_detected;
105
104u16 amd_iommu_last_bdf; 106u16 amd_iommu_last_bdf;
105struct list_head amd_iommu_unity_map; 107struct list_head amd_iommu_unity_map;
106unsigned amd_iommu_aperture_order = 26; 108unsigned amd_iommu_aperture_order = 26;
@@ -689,6 +691,9 @@ int __init amd_iommu_init(void)
689 return 0; 691 return 0;
690 } 692 }
691 693
694 if (!amd_iommu_detected)
695 return -ENODEV;
696
692 /* 697 /*
693 * First parse ACPI tables to find the largest Bus/Dev/Func 698 * First parse ACPI tables to find the largest Bus/Dev/Func
694 * we need to handle. Upon this information the shared data 699 * we need to handle. Upon this information the shared data
@@ -831,6 +836,7 @@ void __init amd_iommu_detect(void)
831 836
832 if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { 837 if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) {
833 iommu_detected = 1; 838 iommu_detected = 1;
839 amd_iommu_detected = 1;
834#ifdef CONFIG_GART_IOMMU 840#ifdef CONFIG_GART_IOMMU
835 gart_iommu_aperture_disabled = 1; 841 gart_iommu_aperture_disabled = 1;
836 gart_iommu_aperture = 0; 842 gart_iommu_aperture = 0;