From: "Vegard Nossum" <vegard.nossum@gmail.com>
To: Len Brown <lenb@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org,
Zhao Yakui <yakui.zhao@intel.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>,
Alexey Starikovskiy <astarikovskiy@suse.de>,
Yinghai Lu <yhlu.kernel@gmail.com>,
Bjorn Helgaas <bjorn.helgaas@hp.com>
Subject: Re: [PATCH] ACPI: don't walk tables if ACPI was disabled
Date: Fri, 20 Jun 2008 22:40:55 +0200 [thread overview]
Message-ID: <19f34abd0806201340t502ce471n578dd2498a5f1992@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.1.10.0806201458500.3027@localhost.localdomain>
On Fri, Jun 20, 2008 at 9:00 PM, Len Brown <lenb@kernel.org> wrote:
>> @@ -333,6 +333,9 @@ static int __init acpi_rtc_init(void)
>> {
>> struct device *dev = get_rtc_dev();
>>
>> + if (acpi_disabled)
>> + return 0;
>> +
>
> hmm, i would expect dev to be 0 for acpi=off,
> since pnp_match would fail, no?
Obviously not. Because Ingo is booting with acpi=off and he still gets
a warning about some mutex operation that originates from this very
initcall:
[ 3.976213] calling acpi_rtc_init+0x0/0xd3
[ 3.980213] ACPI Exception (utmutex-0263): AE_BAD_PARAMETER, Thread
F7C50000 could not acquire Mutex [3] [20080321]
This function seems to do the discovery of the rtc device:
static int __init pnpacpi_init(void)
{
if (acpi_disabled || pnpacpi_disabled) {
pnp_info("PnP ACPI: disabled");
return 0;
}
...
subsys_initcall(pnpacpi_init);
So we have these functions:
1. acpi_early_init() - happens before any initcall. This would
initialize mutexes, but simply returns if acpi_disabled.
2. pnpacpi_init() - subsys_initcall. Does the initial discovery of
pnpacpi devices, but simply returns if acpi_disabled.
3. acpi_init() - subsys_initcall. Simply returns if acpi_disabled.
4. acpi_rtc_init() - fs_initcall (after subsys_initcall).
So I don't know. We also know that things like dock_init() are wrong
for sure (with attached patch):
------------[ cut here ]------------
WARNING: at drivers/acpi/osl.c:821 acpi_os_wait_semaphore+0x21/0xf0()
Modules linked in:
Pid: 1, comm: swapper Not tainted 2.6.26-rc6-00161-g952f4a0-dirty #20
...
[<c0222762>] acpi_os_wait_semaphore+0x21/0xf0
[<c023ce2a>] acpi_ut_acquire_mutex+0x5e/0xc4
[<c0233778>] acpi_walk_namespace+0x24/0x60
[<c05d005f>] dock_init+0x0/0x48
[<c05d008f>] dock_init+0x30/0x48
[<c0242eb3>] find_dock+0x0/0x2f0
[<c05bb422>] kernel_init+0x120/0x254
...
ACPI Exception (utmutex-0263): AE_BAD_PARAMETER, Thread C7820000 could
not acquire Mutex [1] [20080321]
I guess Ingo should revert my bogus changes to acpi_rtc_init() and use
your suggestion of a BUG() (or maybe just WARN()) to catch the
backtrace so we can figure out how it gets there when acpi_disabled.
The only thing I can think of now is that pnp_match() is doing
something wrong. It returns 1 when it shouldn't, or something. But I
can't really spot it :-(
Vegard
diff --git a/drivers/acpi/namespace/nsxfeval.c b/drivers/acpi/namespace/nsxfeval
index a8d5491..7c444de 100644
--- a/drivers/acpi/namespace/nsxfeval.c
+++ b/drivers/acpi/namespace/nsxfeval.c
@@ -556,6 +556,8 @@ acpi_get_devices(const char *HID,
ACPI_FUNCTION_TRACE(acpi_get_devices);
+ WARN_ON(acpi_disabled);
+
/* Parameter validation */
if (!user_function) {
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c
index 235a138..ca661e7 100644
--- a/drivers/acpi/osl.c
+++ b/drivers/acpi/osl.c
@@ -818,6 +818,8 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 u
long jiffies;
int ret = 0;
+ WARN_ON(acpi_disabled);
+
if (!sem || (units < 1))
return AE_BAD_PARAMETER;
next prev parent reply other threads:[~2008-06-20 20:41 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-20 9:52 [bug, acpi] BUG: spinlock bad magic on CPU#0, swapper/1, ACPI Exception (utmutex-0263): AE_BAD_PARAMETER Ingo Molnar
2008-06-20 13:11 ` Vegard Nossum
2008-06-20 13:56 ` [PATCH] ACPI: don't walk tables if ACPI was disabled Vegard Nossum
2008-06-20 14:22 ` Ingo Molnar
2008-06-25 2:34 ` [PATCH] ACPI: add standard linux WARN() output to ACPI warnings Len Brown
2008-06-25 2:49 ` Arjan van de Ven
2008-06-25 3:10 ` Len Brown
2008-06-26 3:57 ` Len Brown
2008-06-20 19:00 ` [PATCH] ACPI: don't walk tables if ACPI was disabled Len Brown
2008-06-20 20:40 ` Vegard Nossum [this message]
2008-06-20 21:27 ` Vegard Nossum
2008-06-21 8:19 ` Vegard Nossum
2008-06-24 11:41 ` Ingo Molnar
2008-06-24 11:52 ` Vegard Nossum
2008-06-24 15:22 ` Bjorn Helgaas
2008-06-25 1:37 ` Zhao Yakui
2008-06-25 15:08 ` Bjorn Helgaas
2008-06-26 3:02 ` Zhao Yakui
2008-06-26 16:44 ` Bjorn Helgaas
2008-06-25 2:41 ` Len Brown
2008-06-25 7:07 ` Ingo Molnar
2008-06-25 3:07 ` Len Brown
2008-06-25 3:07 ` [PATCH 1/4] ACPI: add standard linux WARN() output to ACPI warnings Len Brown
2008-06-25 3:07 ` [PATCH 2/4] ACPI: add WARN_ON(acpi_disabled) Len Brown
2008-06-25 3:07 ` [PATCH 3/4] dock: bay: Don't call acpi_walk_namespace() when ACPI is disabled Len Brown
2008-06-25 3:07 ` [PATCH 4/4] ACPI: don't walk tables if ACPI was disabled Len Brown
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=19f34abd0806201340t502ce471n578dd2498a5f1992@mail.gmail.com \
--to=vegard.nossum@gmail.com \
--cc=astarikovskiy@suse.de \
--cc=bjorn.helgaas@hp.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rjw@sisk.pl \
--cc=yakui.zhao@intel.com \
--cc=yhlu.kernel@gmail.com \
/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