[PATCH 5/6] AMD IOMMU: don't try to init IOMMU if early detect code did not detect one

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joerg Roedel
Date: Thursday, July 3, 2008 - 10:35 am

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>
---
 arch/x86/kernel/amd_iommu_init.c |    6 ++++++
 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 c54c823..c970fac 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -101,6 +101,8 @@ struct ivmd_header {
 	u64 range_length;
 } __attribute__((packed));
 
+static int __initdata amd_iommu_detected;
+
 u16 amd_iommu_last_bdf;
 struct list_head amd_iommu_unity_map;
 unsigned amd_iommu_aperture_order = 26;
@@ -689,6 +691,9 @@ int __init amd_iommu_init(void)
 		return 0;
 	}
 
+	if (!amd_iommu_detected)
+		return -ENODEV;
+
 	/*
 	 * First parse ACPI tables to find the largest Bus/Dev/Func
 	 * we need to handle. Upon this information the shared data
@@ -831,6 +836,7 @@ void __init amd_iommu_detect(void)
 
 	if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) {
 		iommu_detected = 1;
+		amd_iommu_detected = 1;
 #ifdef CONFIG_GART_IOMMU
 		gart_iommu_aperture_disabled = 1;
 		gart_iommu_aperture = 0;
-- 
1.5.3.7


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/6] AMD IOMMU updates, Joerg Roedel, (Thu Jul 3, 10:35 am)
[PATCH 5/6] AMD IOMMU: don't try to init IOMMU if early de ..., Joerg Roedel, (Thu Jul 3, 10:35 am)
Re: [PATCH 0/6] AMD IOMMU updates, Ingo Molnar, (Fri Jul 4, 2:52 am)
Re: [PATCH 0/6] AMD IOMMU updates, FUJITA Tomonori, (Mon Jul 7, 12:40 am)
Re: [PATCH 0/6] AMD IOMMU updates, Ingo Molnar, (Mon Jul 7, 12:44 am)