ACPI / PM: Enable all wakeup GPEs in suspend-to-idle
authorChen Yu <yu.c.chen@intel.com>
Fri, 27 Mar 2015 10:08:48 +0000 (18:08 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sun, 29 Mar 2015 23:52:02 +0000 (01:52 +0200)
Currently, in suspend-to-idle, wakeup GPE for PCI devices are
handled properly because acpi_pci_sleep_wake() invokes acpi_enable_gpe()
to enable the wakeup GPE directly. But for the other wakeup-capable
devices in ACPI bus, acpi_enable_wakeup_devices() should be invoked
to update enable_for_wake mask in gpe_register_info structure, thus
acpi_enable_all_wakeup_gpes() can enable the wakeup GPE referred in
_PRW methods. And acpi_disable_wakeup_devices() will be called
before disable_irq_wake() in acpi_freeze_restore() to restore the mask.

This patch fixes a power button wakeup problem on Surface Pro 3,
on which platform power button uses EC to deliver event
(EC GPE is referred in _PRW).

Note: enabling EC GPE during freeze state may bring some risks
because EC events are expected to fire more frequently than others.
Thus it may bring the system out of freeze state unnecessarily.
(We already have comments about this in bugzilla)

Link: https://bugzilla.kernel.org/show_bug.cgi?id=84651
Reported-and-tested-by: Ethan Schoonover <es@ethanschoonover.com>
Tested-by: Peter Amidon <psa.pub.0@picnicpark.org>
Tested-by: Yani Ioadnnou <yani.ioannou@gmail.com>
Tested-by: Mister Wardrop <mister.wardrop@gmail.com>
Tested-by: Anton Anikin <anton@anikin.name>
Tested-by: Keith McClelland <zismylaptop@gmail.com>
Reviewed-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/sleep.c

index 24a830b39ec3850e5a1565b0ba2b78ed16f38d11..2f0d4db40a9e8aa078787b177d138322fdd6c0b9 100644 (file)
@@ -629,6 +629,7 @@ static int acpi_freeze_begin(void)
 
 static int acpi_freeze_prepare(void)
 {
+       acpi_enable_wakeup_devices(ACPI_STATE_S0);
        acpi_enable_all_wakeup_gpes();
        acpi_os_wait_events_complete();
        enable_irq_wake(acpi_gbl_FADT.sci_interrupt);
@@ -637,6 +638,7 @@ static int acpi_freeze_prepare(void)
 
 static void acpi_freeze_restore(void)
 {
+       acpi_disable_wakeup_devices(ACPI_STATE_S0);
        disable_irq_wake(acpi_gbl_FADT.sci_interrupt);
        acpi_enable_all_runtime_gpes();
 }
This page took 0.026089 seconds and 5 git commands to generate.