mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel@amd.com>
To: mingo@redhat.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
	bhavna.sarathy@amd.com, robert.richter@amd.com,
	Joerg Roedel <joerg.roedel@amd.com>
Subject: [PATCH 5/6] AMD IOMMU: don't try to init IOMMU if early detect code did not detect one
Date: Thu, 3 Jul 2008 19:35:10 +0200	[thread overview]
Message-ID: <1215106511-12915-6-git-send-email-joerg.roedel@amd.com> (raw)
In-Reply-To: <1215106511-12915-1-git-send-email-joerg.roedel@amd.com>

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



  parent reply	other threads:[~2008-07-03 17:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03 17:35 [PATCH 0/6] AMD IOMMU updates Joerg Roedel
2008-07-03 17:35 ` [PATCH 1/6] AMD IOMMU: more verbose Kconfig description text Joerg Roedel
2008-07-03 17:35 ` [PATCH 2/6] AMD IOMMU: remove unnecessary set_bit_string Joerg Roedel
2008-07-03 17:35 ` [PATCH 3/6] AMD IOMMU: flush domain TLB when there is more than one page to flush Joerg Roedel
2008-07-03 18:01   ` [PATCH 3/6] AMD IOMMU: flush domain TLB when there is more than onepage " Duran, Leo
2008-07-03 17:35 ` [PATCH 4/6] AMD IOMMU: honor iommu=off instead of amd_iommu=off Joerg Roedel
2008-07-03 17:35 ` Joerg Roedel [this message]
2008-07-03 17:35 ` [PATCH 6/6] AMD IOMMU: remove unnecessary code from the iommu_enable function Joerg Roedel
2008-07-04  9:52 ` [PATCH 0/6] AMD IOMMU updates Ingo Molnar
2008-07-07  7:40   ` FUJITA Tomonori
2008-07-07  7:44     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1215106511-12915-6-git-send-email-joerg.roedel@amd.com \
    --to=joerg.roedel@amd.com \
    --cc=bhavna.sarathy@amd.com \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=robert.richter@amd.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®