summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-07-15 17:51:19 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-07-23 03:46:33 -0400
commit41275eb5c7181febdfaa63c3a0ad9b7acdadcd52 (patch)
tree73b1a1ac9eb8203030a55dcb2f2d133a1d59626f /drivers/acpi/sleep.c
parent2933954b71f10d392764f95eec0f0aa2d103054b (diff)
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 <rafael.j.wysocki@intel.com> Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r--drivers/acpi/sleep.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index f0fe7c15d657..3debe1a42655 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -972,6 +972,8 @@ static int acpi_s2idle_prepare(void)
972 /* Change the configuration of GPEs to avoid spurious wakeup. */ 972 /* Change the configuration of GPEs to avoid spurious wakeup. */
973 acpi_enable_all_wakeup_gpes(); 973 acpi_enable_all_wakeup_gpes();
974 acpi_os_wait_events_complete(); 974 acpi_os_wait_events_complete();
975
976 s2idle_wakeup = true;
975 return 0; 977 return 0;
976} 978}
977 979
@@ -991,7 +993,6 @@ static void acpi_s2idle_wake(void)
991 if (acpi_sci_irq_valid() && 993 if (acpi_sci_irq_valid() &&
992 !irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) { 994 !irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq))) {
993 pm_system_cancel_wakeup(); 995 pm_system_cancel_wakeup();
994 s2idle_wakeup = true;
995 /* 996 /*
996 * On some platforms with the LPS0 _DSM device noirq resume 997 * On some platforms with the LPS0 _DSM device noirq resume
997 * takes too much time for EC wakeup events to survive, so look 998 * takes too much time for EC wakeup events to survive, so look
@@ -1012,11 +1013,12 @@ static void acpi_s2idle_sync(void)
1012 acpi_os_wait_events_complete(); /* synchronize SCI IRQ handling */ 1013 acpi_os_wait_events_complete(); /* synchronize SCI IRQ handling */
1013 acpi_ec_flush_work(); 1014 acpi_ec_flush_work();
1014 acpi_os_wait_events_complete(); /* synchronize Notify handling */ 1015 acpi_os_wait_events_complete(); /* synchronize Notify handling */
1015 s2idle_wakeup = false;
1016} 1016}
1017 1017
1018static void acpi_s2idle_restore(void) 1018static void acpi_s2idle_restore(void)
1019{ 1019{
1020 s2idle_wakeup = false;
1021
1020 acpi_enable_all_runtime_gpes(); 1022 acpi_enable_all_runtime_gpes();
1021 1023
1022 acpi_disable_wakeup_devices(ACPI_STATE_S0); 1024 acpi_disable_wakeup_devices(ACPI_STATE_S0);