aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2008-01-07 18:06:16 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 18:30:56 -0500
commit3c1d2b6085d75df0691cec6a4a053c0aa55fe4c9 (patch)
treecf5b546db40f51c874041250128104cb4344331b /drivers/acpi
parentc95d47a868f35cd47643d116a3c680cdaa954df8 (diff)
ACPI: Separate disabling of GPEs from _PTS
The preparation to enter an ACPI system sleep state is now tied to the disabling of GPEs, but the GPEs should not be disabled before suspending devices. Since on ACPI 1.0x systems the _PTS global control method should be executed before suspending devices, we need to disable GPEs separately. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/hardware/hwsleep.c4
-rw-r--r--drivers/acpi/sleep/main.c17
2 files changed, 15 insertions, 6 deletions
diff --git a/drivers/acpi/hardware/hwsleep.c b/drivers/acpi/hardware/hwsleep.c
index 13c93a13785e..fd1c4ba63367 100644
--- a/drivers/acpi/hardware/hwsleep.c
+++ b/drivers/acpi/hardware/hwsleep.c
@@ -229,10 +229,6 @@ acpi_status acpi_enter_sleep_state_prep(u8 sleep_state)
229 "While executing method _SST")); 229 "While executing method _SST"));
230 } 230 }
231 231
232 /* Disable/Clear all GPEs */
233
234 status = acpi_hw_disable_all_gpes();
235
236 return_ACPI_STATUS(status); 232 return_ACPI_STATUS(status);
237} 233}
238 234
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index fdd8139b3f98..198ff8a1529a 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -91,10 +91,13 @@ static int acpi_pm_begin(suspend_state_t pm_state)
91 91
92static int acpi_pm_prepare(void) 92static int acpi_pm_prepare(void)
93{ 93{
94 int error = acpi_sleep_prepare(acpi_target_sleep_state); 94 int error;
95 95
96 error = acpi_sleep_prepare(acpi_target_sleep_state);
96 if (error) 97 if (error)
97 acpi_target_sleep_state = ACPI_STATE_S0; 98 acpi_target_sleep_state = ACPI_STATE_S0;
99 else if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes()))
100 error = -EFAULT;
98 101
99 return error; 102 return error;
100} 103}
@@ -261,7 +264,16 @@ static int acpi_hibernation_start(void)
261 264
262static int acpi_hibernation_prepare(void) 265static int acpi_hibernation_prepare(void)
263{ 266{
264 return acpi_sleep_prepare(ACPI_STATE_S4); 267 int error;
268
269 error = acpi_sleep_prepare(ACPI_STATE_S4);
270 if (error)
271 return error;
272
273 if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes()))
274 error = -EFAULT;
275
276 return error;
265} 277}
266 278
267static int acpi_hibernation_enter(void) 279static int acpi_hibernation_enter(void)
@@ -426,6 +438,7 @@ static void acpi_power_off_prepare(void)
426{ 438{
427 /* Prepare to power off the system */ 439 /* Prepare to power off the system */
428 acpi_sleep_prepare(ACPI_STATE_S5); 440 acpi_sleep_prepare(ACPI_STATE_S5);
441 acpi_hw_disable_all_gpes();
429} 442}
430 443
431static void acpi_power_off(void) 444static void acpi_power_off(void)