diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-12-01 17:51:13 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-12-01 17:51:13 -0500 |
commit | c52fa70c79acbb1d4868fee244a638d6ee6f5aab (patch) | |
tree | 9e67a8220b3eec6a1fae5c2145475dea7fb4f42b | |
parent | 331dfcf830a424dacbe11f0543ebf6097ae89964 (diff) |
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>
-rw-r--r-- | drivers/acpi/sleep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 05a31b573fc3..8aa9254a387f 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
@@ -630,6 +630,7 @@ static int acpi_freeze_begin(void) | |||
630 | static int acpi_freeze_prepare(void) | 630 | static int acpi_freeze_prepare(void) |
631 | { | 631 | { |
632 | acpi_enable_all_wakeup_gpes(); | 632 | acpi_enable_all_wakeup_gpes(); |
633 | acpi_os_wait_events_complete(); | ||
633 | enable_irq_wake(acpi_gbl_FADT.sci_interrupt); | 634 | enable_irq_wake(acpi_gbl_FADT.sci_interrupt); |
634 | return 0; | 635 | return 0; |
635 | } | 636 | } |
@@ -825,6 +826,7 @@ static void acpi_power_off_prepare(void) | |||
825 | /* Prepare to power off the system */ | 826 | /* Prepare to power off the system */ |
826 | acpi_sleep_prepare(ACPI_STATE_S5); | 827 | acpi_sleep_prepare(ACPI_STATE_S5); |
827 | acpi_disable_all_gpes(); | 828 | acpi_disable_all_gpes(); |
829 | acpi_os_wait_events_complete(); | ||
828 | } | 830 | } |
829 | 831 | ||
830 | static void acpi_power_off(void) | 832 | static void acpi_power_off(void) |