Skip to content

Commit

Permalink
ACPI: avoid irqrouter_resume might_sleep oops on resume from S4
Browse files Browse the repository at this point in the history
__might_sleep+0x8e/0x93
acpi_os_wait_semaphore+0x50/0xa3
acpi_ut_acquire_mutex+0x28/0x6a
acpi_ns_get_node+0x46/0x88
acpi_ns_evaluate+0x2d/0xfc
acpi_rs_set_srs_method_data+0xc5/0xe1
acpi_set_current_resources+0x31/0x3f
acpi_pci_link_set+0xfc/0x1a5
irqrouter_resume+0x48/0x5f

and

__might_sleep+0x8e/0x93
kmem_cache_alloc+0x2a/0x8f
acpi_evaluate_integer+0x32/0x96
acpi_bus_get_status+0x30/0x84
acpi_pci_link_set+0x12a/0x1a5
irqrouter_resume+0x48/0x5f

http://bugzilla.kernel.org/show_bug.cgi?id=6810

Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Len Brown committed Aug 16, 2006
1 parent b5240b3 commit d68909f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,16 @@ acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout)
ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",
handle, units, timeout));

/*
* This can be called during resume with interrupts off.
* Like boot-time, we should be single threaded and will
* always get the lock if we try -- timeout or not.
* If this doesn't succeed, then we will oops courtesy of
* might_sleep() in down().
*/
if (!down_trylock(sem))
return AE_OK;

switch (timeout) {
/*
* No Wait:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ acpi_evaluate_integer(acpi_handle handle,
if (!data)
return AE_BAD_PARAMETER;

element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
element = kmalloc(sizeof(union acpi_object), irqs_disabled() ? GFP_ATOMIC: GFP_KERNEL);
if (!element)
return AE_NO_MEMORY;

Expand Down

0 comments on commit d68909f

Please sign in to comment.