aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sleep.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-29 20:29:01 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-09-30 15:06:07 -0400
commita8d46b9e4e487301affe84fa53de40b890898604 (patch)
treee03c49af92828182b84be290a771c080ba565aca /drivers/acpi/sleep.c
parentebc3e41e371620bae6c315c9174bcb2d6c4e9ae7 (diff)
ACPI / sleep: Rework the handling of ACPI GPE wakeup from suspend-to-idle
The ACPI GPE wakeup from suspend-to-idle is currently based on using the IRQF_NO_SUSPEND flag for the ACPI SCI, but that is problematic for a couple of reasons. First, in principle the ACPI SCI may be shared and IRQF_NO_SUSPEND does not really work well with shared interrupts. Second, it may require the ACPI subsystem to special-case the handling of device notifications depending on whether or not they are received during suspend-to-idle in some places which would lead to fragile code. Finally, it's better the handle ACPI wakeup interrupts consistently with wakeup interrupts from other sources. For this reason, remove the IRQF_NO_SUSPEND flag from the ACPI SCI and use enable_irq_wake()/disable_irq_wake() with it instead, which requires two additional platform hooks to be added to struct platform_freeze_ops. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/sleep.c')
-rw-r--r--drivers/acpi/sleep.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
index 54da4a3fe65e..05a31b573fc3 100644
--- a/drivers/acpi/sleep.c
+++ b/drivers/acpi/sleep.c
@@ -14,6 +14,7 @@
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/dmi.h> 15#include <linux/dmi.h>
16#include <linux/device.h> 16#include <linux/device.h>
17#include <linux/interrupt.h>
17#include <linux/suspend.h> 18#include <linux/suspend.h>
18#include <linux/reboot.h> 19#include <linux/reboot.h>
19#include <linux/acpi.h> 20#include <linux/acpi.h>
@@ -626,6 +627,19 @@ static int acpi_freeze_begin(void)
626 return 0; 627 return 0;
627} 628}
628 629
630static int acpi_freeze_prepare(void)
631{
632 acpi_enable_all_wakeup_gpes();
633 enable_irq_wake(acpi_gbl_FADT.sci_interrupt);
634 return 0;
635}
636
637static void acpi_freeze_restore(void)
638{
639 disable_irq_wake(acpi_gbl_FADT.sci_interrupt);
640 acpi_enable_all_runtime_gpes();
641}
642
629static void acpi_freeze_end(void) 643static void acpi_freeze_end(void)
630{ 644{
631 acpi_scan_lock_release(); 645 acpi_scan_lock_release();
@@ -633,6 +647,8 @@ static void acpi_freeze_end(void)
633 647
634static const struct platform_freeze_ops acpi_freeze_ops = { 648static const struct platform_freeze_ops acpi_freeze_ops = {
635 .begin = acpi_freeze_begin, 649 .begin = acpi_freeze_begin,
650 .prepare = acpi_freeze_prepare,
651 .restore = acpi_freeze_restore,
636 .end = acpi_freeze_end, 652 .end = acpi_freeze_end,
637}; 653};
638 654