Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rafael J. Wysocki and committed by
Len Brown
3c1d2b60 c95d47a8

+15 -6
-4
drivers/acpi/hardware/hwsleep.c
··· 229 229 "While executing method _SST")); 230 230 } 231 231 232 - /* Disable/Clear all GPEs */ 233 - 234 - status = acpi_hw_disable_all_gpes(); 235 - 236 232 return_ACPI_STATUS(status); 237 233 } 238 234
+15 -2
drivers/acpi/sleep/main.c
··· 91 91 92 92 static 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 97 if (error) 97 98 acpi_target_sleep_state = ACPI_STATE_S0; 99 + else if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes())) 100 + error = -EFAULT; 98 101 99 102 return error; 100 103 } ··· 264 261 265 262 static int acpi_hibernation_prepare(void) 266 263 { 267 - return acpi_sleep_prepare(ACPI_STATE_S4); 264 + int error; 265 + 266 + error = acpi_sleep_prepare(ACPI_STATE_S4); 267 + if (error) 268 + return error; 269 + 270 + if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes())) 271 + error = -EFAULT; 272 + 273 + return error; 268 274 } 269 275 270 276 static int acpi_hibernation_enter(void) ··· 438 426 { 439 427 /* Prepare to power off the system */ 440 428 acpi_sleep_prepare(ACPI_STATE_S5); 429 + acpi_hw_disable_all_gpes(); 441 430 } 442 431 443 432 static void acpi_power_off(void)