Bug 6810
Summary: | ACPI sleeping with interrupts disabled | ||
---|---|---|---|
Product: | ACPI | Reporter: | Alan Stern (stern) |
Component: | ACPICA-Core | Assignee: | Len Brown (lenb) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | acpi-bugzilla |
Priority: | P2 | ||
Hardware: | i386 | ||
OS: | Linux | ||
Kernel Version: | 2.6.18-rc1 | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Attachments: |
dmesg log of bootup
dmesg log of suspend-to-disk and resume dmesg log of suspend-to-disk and resume with timeout set to 0 patch vs 2.6.18-rc2 patch vs 2.6.18-rc4 |
Description
Alan Stern
2006-07-10 15:52:30 UTC
Created attachment 8524 [details]
dmesg log of bootup
Created attachment 8525 [details] dmesg log of suspend-to-disk and resume Note: This test was made using 2.6.18-rc1 plus the changes in Greg KH's gregkh-all-2.6.18-rc1 patch plus the patch attached to bug #3469. Created attachment 8526 [details]
dmesg log of suspend-to-disk and resume with timeout set to 0
This test was run with the same kernel as before, plus this patch:
--- usb-2.6.orig/drivers/acpi/osl.c
+++ usb-2.6/drivers/acpi/osl.c
@@ -758,6 +758,9 @@ acpi_status acpi_os_wait_semaphore(acpi_
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
handle, units, timeout));
+ if (irqs_disabled())
+ timeout = 0;
+
switch (timeout) {
/*
* No Wait:
Created attachment 8623 [details]
patch vs 2.6.18-rc2
seems devious to nuke the timeout if irqs disabled.
Perhaps this patch to simply do a lock_try() upfront
is more understandable?
I can't try your patch right now, but it looks like it should solve the problem involving acpi_os_wait_semaphore. But what about the oops shown in attachment 8526 [details] (comment #3)? Are acpi_pci_link_set() and its subordinates supposed to be able to run with interrupts disabled? re: comment #3 and comment #5, yes, there is a different patch for acpi_evaluate_integer(). The direct answer to your question is NO, acpi_pci_link_set() is NOT designed to be called with interrupts off -- because it can call the AML in interpreter, which needs to allocate. It magically works at boot time due to system_state. Although suspend/resume is analogous to boot time, it was deemed preferable to hack all the invocations that might provoke might_sleep() rather than to deal with it again in once place. This route wasn't my 1st choice, can you tell?:-) Created attachment 8805 [details]
patch vs 2.6.18-rc4
this consolidated patch handles both the acpi_os_acquire_semaphore() case
and the acpi_evaluate_integer() case.
The attachment in comment #7 works okay. In fact, when I tried it without the hunk for acpi_evaluate_integer() it still worked! Apparently something else has changed in the interim, and as a result that routine is no longer called at a bad time. Leaving out the original change to acpi_os_acquire_semaphore() did cause the error to re-appear, so that much _is_ necessary. By the way, I noticed that this patch could go ahead to simplify the timeout==0 case in the big "switch" statement. shipped upstream post 2.6.18-rc4. closed. |