[PATCH] ACPI: don't walk tables if ACPI was disabled

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>
Cc: <linux-kernel@...>, Len Brown <lenb@...>, <linux-acpi@...>, Zhao Yakui <yakui.zhao@...>, Rafael J. Wysocki <rjw@...>, Alexey Starikovskiy <astarikovskiy@...>, Yinghai Lu <yhlu.kernel@...>
Date: Friday, June 20, 2008 - 9:56 am

Hi Ingo,

Can you see if this patch solves your problem? There might be other
functions that needs this guard as well, though. I wonder if maybe this test
should just be included at the top of every driver that uses ACPI in some
way. But I'm pretty sure that this lack of initialization is the root of your
problem in any case :-)

(By the way, I don't know why this problem popped up at this time, maybe it
was just bad timing/bad luck... How far back do your AE_BAD_PARAMETER in the
logs go?)


Vegard


From: Vegard Nossum <vegard.nossum@gmail.com>
Date: Fri, 20 Jun 2008 15:39:09 +0200
Subject: [PATCH] ACPI: don't walk tables if ACPI was disabled

Ingo Molnar wrote:

This is apparently because some parts of ACPI, including mutexes, are not
initialized when acpi=off is passed to the kernel.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
---
 drivers/acpi/glue.c               |    3 +++
 drivers/acpi/namespace/nsxfeval.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 2808dc6..9b227d4 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -333,6 +333,9 @@ static int __init acpi_rtc_init(void)
 {
 	struct device *dev = get_rtc_dev();
 
+	if (acpi_disabled)
+		return 0;
+
 	if (dev) {
 		rtc_wake_setup();
 		rtc_info.wake_on = rtc_wake_on;
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval.c
index a8d5491..c274d1d 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -391,6 +391,9 @@ acpi_walk_namespace(acpi_object_type type,
 
 	ACPI_FUNCTION_TRACE(acpi_walk_namespace);
 
+	if (acpi_disabled)
+		return_ACPI_STATUS(AE_NO_NAMESPACE);
+
 	/* Parameter validation */
 
 	if ((type > ACPI_TYPE_LOCAL_MAX) || (!max_depth) || (!user_function)) {
-- 
1.5.4.1

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

Messages in current thread:
[PATCH] ACPI: don't walk tables if ACPI was disabled, Vegard Nossum, (Fri Jun 20, 9:56 am)
Re: [PATCH] ACPI: don't walk tables if ACPI was disabled, Vegard Nossum, (Fri Jun 20, 4:40 pm)
Re: [PATCH] ACPI: don't walk tables if ACPI was disabled, Vegard Nossum, (Fri Jun 20, 5:27 pm)
Re: [PATCH] ACPI: don't walk tables if ACPI was disabled, Vegard Nossum, (Sat Jun 21, 4:19 am)
Re: [PATCH] ACPI: don't walk tables if ACPI was disabled, Vegard Nossum, (Tue Jun 24, 7:52 am)
Re: [PATCH] ACPI: don't walk tables if ACPI was disabled, Bjorn Helgaas, (Wed Jun 25, 11:08 am)
Re: [PATCH] ACPI: don't walk tables if ACPI was disabled, Bjorn Helgaas, (Thu Jun 26, 12:44 pm)
Re: [PATCH] ACPI: don't walk tables if ACPI was disabled, Bjorn Helgaas, (Tue Jun 24, 11:22 am)
Re: [PATCH] ACPI: add standard linux WARN() output to ACPI w..., Arjan van de Ven, (Tue Jun 24, 10:49 pm)