]> err.no Git - linux-2.6/commitdiff
Hibernation: Make sure that ACPI is enabled in acpi_hibernation_finish
authorRafael J. Wysocki <rjw@sisk.pl>
Tue, 2 Oct 2007 20:24:08 +0000 (13:24 -0700)
committerLen Brown <len.brown@intel.com>
Wed, 10 Oct 2007 04:23:09 +0000 (00:23 -0400)
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).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/sleep/main.c

index 2cbb9aabd00eba4c8eeb395deb922dcc36fb6980..caf8721ae6fb4964c60ad67c60aa4fa5f63c07a5 100644 (file)
@@ -256,6 +256,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);