summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-07-11 09:58:16 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-07-11 09:58:16 -0700
commit5d58093285d00ddf5f7e9b438c8e769cae2b24ee (patch)
tree3846fbcd179923b516f5879c142287caa4ea4716 /drivers
parent1e09177acae32a61586af26d83ca5ef591cdcaf5 (diff)
parentfa85015c0d95884c8dc42f38e2f2d6137d436b67 (diff)
Merge tag 'acpi-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI fix from Rafael Wysocki: "Address a regression in ACPICA that ceased to clear the status of GPEs and fixed events before entering the ACPI S5 (off) system state during the 4.17 cycle which caused some systems to power up immediately after they had been turned off" * tag 'acpi-4.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: ACPICA: Clear status of all events when entering S5
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/acpica/hwsleep.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/hwsleep.c b/drivers/acpi/acpica/hwsleep.c
index fc0c2e2328cd..fe9d46d81750 100644
--- a/drivers/acpi/acpica/hwsleep.c
+++ b/drivers/acpi/acpica/hwsleep.c
@@ -51,16 +51,23 @@ acpi_status acpi_hw_legacy_sleep(u8 sleep_state)
return_ACPI_STATUS(status);
}
- /*
- * 1) Disable all GPEs
- * 2) Enable all wakeup GPEs
- */
+ /* Disable all GPEs */
status = acpi_hw_disable_all_gpes();
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);
}
+ /*
+ * If the target sleep state is S5, clear all GPEs and fixed events too
+ */
+ if (sleep_state == ACPI_STATE_S5) {
+ status = acpi_hw_clear_acpi_status();
+ if (ACPI_FAILURE(status)) {
+ return_ACPI_STATUS(status);
+ }
+ }
acpi_gbl_system_awake_and_running = FALSE;
+ /* Enable all wakeup GPEs */
status = acpi_hw_enable_all_wakeup_gpes();
if (ACPI_FAILURE(status)) {
return_ACPI_STATUS(status);