Skip to content

Commit c52fa70

Browse files
committed
ACPI / sleep: Drain outstanding events after disabling multiple GPEs
After multiple GPEs have been disabled at the low level in one go, like when acpi_disable_all_gpes() is called, we should always drain all of the outstanding events from them, or interesting races become possible. For this reason, call acpi_os_wait_events_complete() after acpi_enable_all_wakeup_gpes() and acpi_disable_all_gpes() in acpi_freeze_prepare() and acpi_power_off_prepare(), respectively. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 331dfcf commit c52fa70

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/acpi/sleep.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ static int acpi_freeze_begin(void)
630630
static int acpi_freeze_prepare(void)
631631
{
632632
acpi_enable_all_wakeup_gpes();
633+
acpi_os_wait_events_complete();
633634
enable_irq_wake(acpi_gbl_FADT.sci_interrupt);
634635
return 0;
635636
}
@@ -825,6 +826,7 @@ static void acpi_power_off_prepare(void)
825826
/* Prepare to power off the system */
826827
acpi_sleep_prepare(ACPI_STATE_S5);
827828
acpi_disable_all_gpes();
829+
acpi_os_wait_events_complete();
828830
}
829831

830832
static void acpi_power_off(void)

0 commit comments

Comments
 (0)