From 8a0bb7362587807fec985f72fb0317aa8ed24835 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 2 Oct 2007 13:24:08 -0700 Subject: Hibernation: Make sure that ACPI is enabled in acpi_hibernation_finish 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 Acked-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/sleep/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers') diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 2cbb9aabd00e..caf8721ae6fb 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -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); -- cgit v1.2.3 From 6cffd46651b881a11791a7ef4d99f2f20853fcd9 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 2 Oct 2007 13:24:09 -0700 Subject: ACPI: clean up acpi_enter_sleep_state_prep Remove some redundant code from acpi_enter_sleep_state_prep() and clean up a comment in there. Signed-off-by: Rafael J. Wysocki Acked-by: Pavel Machek Signed-off-by: Andrew Morton Signed-off-by: Len Brown --- drivers/acpi/hardware/hwsleep.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c index cf69c0040a39..8181afbd1d4d 100644 --- a/drivers/acpi/hardware/hwsleep.c +++ b/drivers/acpi/hardware/hwsleep.c @@ -234,15 +234,11 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) "While executing method _SST")); } - /* - * 1) Disable/Clear all GPEs - */ + /* Disable/Clear all GPEs */ + status = acpi_hw_disable_all_gpes(); - if (ACPI_FAILURE(status)) { - return_ACPI_STATUS(status); - } - return_ACPI_STATUS(AE_OK); + return_ACPI_STATUS(status); } ACPI_EXPORT_SYMBOL(acpi_enter_sleep_state_prep) -- cgit v1.2.3