提交 11e981f1 编写于 作者: D David Shaohua Li 提交者: Len Brown

[ACPI] S3 resume: avoid kmalloc() might_sleep oops symptom

ACPI now uses kmalloc(...,GPF_ATOMIC) during suspend/resume.

http://bugzilla.kernel.org/show_bug.cgi?id=3469Signed-off-by: NDavid Shaohua Li <shaohua.li@intel.com>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 8066eff0
...@@ -145,10 +145,14 @@ acpi_os_vprintf(const char *fmt, va_list args) ...@@ -145,10 +145,14 @@ acpi_os_vprintf(const char *fmt, va_list args)
#endif #endif
} }
extern int acpi_in_resume;
void * void *
acpi_os_allocate(acpi_size size) acpi_os_allocate(acpi_size size)
{ {
return kmalloc(size, GFP_KERNEL); if (acpi_in_resume)
return kmalloc(size, GFP_ATOMIC);
else
return kmalloc(size, GFP_KERNEL);
} }
void void
......
...@@ -798,6 +798,11 @@ acpi_pci_link_resume( ...@@ -798,6 +798,11 @@ acpi_pci_link_resume(
return_VALUE(0); return_VALUE(0);
} }
/*
* FIXME: this is a workaround to avoid nasty warning. It will be removed
* after every device calls pci_disable_device in .resume.
*/
int acpi_in_resume;
static int static int
irqrouter_resume( irqrouter_resume(
struct sys_device *dev) struct sys_device *dev)
...@@ -807,6 +812,7 @@ irqrouter_resume( ...@@ -807,6 +812,7 @@ irqrouter_resume(
ACPI_FUNCTION_TRACE("irqrouter_resume"); ACPI_FUNCTION_TRACE("irqrouter_resume");
acpi_in_resume = 1;
list_for_each(node, &acpi_link.entries) { list_for_each(node, &acpi_link.entries) {
link = list_entry(node, struct acpi_pci_link, node); link = list_entry(node, struct acpi_pci_link, node);
if (!link) { if (!link) {
...@@ -816,6 +822,7 @@ irqrouter_resume( ...@@ -816,6 +822,7 @@ irqrouter_resume(
} }
acpi_pci_link_resume(link); acpi_pci_link_resume(link);
} }
acpi_in_resume = 0;
return_VALUE(0); return_VALUE(0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册