From c18e874fbef1cfa7f74b4d49bbe43d1ce1402300 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Tue, 8 Jan 2008 00:06:16 +0100 Subject: [PATCH] --- yaml --- r: 82390 b: refs/heads/master c: 3c1d2b6085d75df0691cec6a4a053c0aa55fe4c9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/acpi/hardware/hwsleep.c | 4 ---- trunk/drivers/acpi/sleep/main.c | 17 +++++++++++++++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 82616112d6c3..75d40db4d57a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c95d47a868f35cd47643d116a3c680cdaa954df8 +refs/heads/master: 3c1d2b6085d75df0691cec6a4a053c0aa55fe4c9 diff --git a/trunk/drivers/acpi/hardware/hwsleep.c b/trunk/drivers/acpi/hardware/hwsleep.c index 13c93a13785e..fd1c4ba63367 100644 --- a/trunk/drivers/acpi/hardware/hwsleep.c +++ b/trunk/drivers/acpi/hardware/hwsleep.c @@ -229,10 +229,6 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state) "While executing method _SST")); } - /* Disable/Clear all GPEs */ - - status = acpi_hw_disable_all_gpes(); - return_ACPI_STATUS(status); } diff --git a/trunk/drivers/acpi/sleep/main.c b/trunk/drivers/acpi/sleep/main.c index fdd8139b3f98..198ff8a1529a 100644 --- a/trunk/drivers/acpi/sleep/main.c +++ b/trunk/drivers/acpi/sleep/main.c @@ -91,10 +91,13 @@ static int acpi_pm_begin(suspend_state_t pm_state) static int acpi_pm_prepare(void) { - int error = acpi_sleep_prepare(acpi_target_sleep_state); + int error; + error = acpi_sleep_prepare(acpi_target_sleep_state); if (error) acpi_target_sleep_state = ACPI_STATE_S0; + else if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes())) + error = -EFAULT; return error; } @@ -261,7 +264,16 @@ static int acpi_hibernation_start(void) static int acpi_hibernation_prepare(void) { - return acpi_sleep_prepare(ACPI_STATE_S4); + int error; + + error = acpi_sleep_prepare(ACPI_STATE_S4); + if (error) + return error; + + if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes())) + error = -EFAULT; + + return error; } static int acpi_hibernation_enter(void) @@ -426,6 +438,7 @@ static void acpi_power_off_prepare(void) { /* Prepare to power off the system */ acpi_sleep_prepare(ACPI_STATE_S5); + acpi_hw_disable_all_gpes(); } static void acpi_power_off(void)