Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11e981f1 authored by David Shaohua Li's avatar David Shaohua Li Committed by Len Brown
Browse files

[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=3469



Signed-off-by: default avatarDavid Shaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 8066eff0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -145,9 +145,13 @@ acpi_os_vprintf(const char *fmt, va_list args)
#endif
}

extern int acpi_in_resume;
void *
acpi_os_allocate(acpi_size size)
{
	if (acpi_in_resume)
		return kmalloc(size, GFP_ATOMIC);
	else
		return kmalloc(size, GFP_KERNEL);
}

+7 −0
Original line number Diff line number Diff line
@@ -798,6 +798,11 @@ acpi_pci_link_resume(
		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
irqrouter_resume(
	struct sys_device *dev)
@@ -807,6 +812,7 @@ irqrouter_resume(

	ACPI_FUNCTION_TRACE("irqrouter_resume");

	acpi_in_resume = 1;
	list_for_each(node, &acpi_link.entries) {
		link = list_entry(node, struct acpi_pci_link, node);
		if (!link) {
@@ -816,6 +822,7 @@ irqrouter_resume(
		}
		acpi_pci_link_resume(link);
	}
	acpi_in_resume = 0;
	return_VALUE(0);
}