Skip to contentSkip to conversation

Hibernation: Make sure that ACPI is enabled in acpi_hibernation_finish

PATCH New Rafael J. Wysocki 1 participant 1 message Aug 21, 2007 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Hibernation: Make sure that ACPI is enabled in acpi_hibernation_finish

From: Rafael J. Wysocki <[email protected]>

If the BIOS does not enable ACPI and the "acpi=off" command line parameter is passed to the boot kernel, ACPI may be disabled when the (restored) image kernel attempts to execute acpi_hibernation_finish(). To prevent this from happening we can call acpi_enable() from acpi_hibernation_finish() (if ACPI is already enabled, this will have no effect).

---
 drivers/acpi/sleep/main.c |    5 +++++
 1 file changed, 5 insertions(+)
drivers/acpi/sleep/main.c +5 -0
Index: linux-2.6.23-rc3/drivers/acpi/sleep/main.c
===================================================================
@@ -240,6 +240,11 @@ static int acpi_hibernation_enter(void)
 
 static void acpi_hibernation_finish(void)
 {
+	/*
+	 * If ACPI is not enabled by the BIOS and the boot kernel, we need to
+	 * enable it here.
+	 */
+	acpi_enable();
 	acpi_leave_sleep_state(ACPI_STATE_S4);
 	acpi_disable_wakeup_device(ACPI_STATE_S4);