Skip to content

Commit 41275eb

Browse files
committed
ACPI: PM: Set s2idle_wakeup earlier and clear it later
The role of the s2idle_wakeup variable is to cause acpi_pm_wakeup_event() and acpi_pm_notify_handler() to increment pm_abort_suspend and trigger a wakeup from suspend-to-idle in case the ACPI SCI wakeup was canceled by acpi_s2idle_wake(). However, for this purpose it need not be set in acpi_s2idle_wake() and cleared in acpi_s2idle_sync(), respectively. In fact, it may be set as early as in acpi_s2idle_prepare() and cleared as late as in acpi_s2idle_restore(), so do that to allow subsequent changes to be simpler. This change is not expected to alter functionality. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Thomas Gleixner <[email protected]>
1 parent 2933954 commit 41275eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/acpi/sleep.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,8 @@ static int acpi_s2idle_prepare(void)
972972
/* Change the configuration of GPEs to avoid spurious wakeup. */
973973
acpi_enable_all_wakeup_gpes();
974974
acpi_os_wait_events_complete();
975+
976+
s2idle_wakeup = true;
975977
return 0;
976978
}
977979

@@ -991,7 +993,6 @@ static void acpi_s2idle_wake(void)
991993
if (acpi_sci_irq_valid() &&
992994
!irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) {
993995
pm_system_cancel_wakeup();
994-
s2idle_wakeup = true;
995996
/*
996997
* On some platforms with the LPS0 _DSM device noirq resume
997998
* takes too much time for EC wakeup events to survive, so look
@@ -1012,11 +1013,12 @@ static void acpi_s2idle_sync(void)
10121013
acpi_os_wait_events_complete(); /* synchronize SCI IRQ handling */
10131014
acpi_ec_flush_work();
10141015
acpi_os_wait_events_complete(); /* synchronize Notify handling */
1015-
s2idle_wakeup = false;
10161016
}
10171017

10181018
static void acpi_s2idle_restore(void)
10191019
{
1020+
s2idle_wakeup = false;
1021+
10201022
acpi_enable_all_runtime_gpes();
10211023

10221024
acpi_disable_wakeup_devices(ACPI_STATE_S0);

0 commit comments

Comments
 (0)