linux/drivers/acpi
Rafael J. Wysocki 33e4f80ee6 ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle
The ACPI SCI (System Control Interrupt) is set up as a wakeup IRQ
during suspend-to-idle transitions and, consequently, any events
signaled through it wake up the system from that state.  However,
on some systems some of the events signaled via the ACPI SCI while
suspended to idle should not cause the system to wake up.  In fact,
quite often they should just be discarded.

Arguably, systems should not resume entirely on such events, but in
order to decide which events really should cause the system to resume
and which are spurious, it is necessary to resume up to the point
when ACPI SCIs are actually handled and processed, which is after
executing dpm_resume_noirq() in the system resume path.

For this reasons, add a loop around freeze_enter() in which the
platforms can process events signaled via multiplexed IRQ lines
like the ACPI SCI and add suspend-to-idle hooks that can be
used for this purpose to struct platform_freeze_ops.

In the ACPI case, the ->wake hook is used for checking if the SCI
has triggered while suspended and deferring the interrupt-induced
system wakeup until the events signaled through it are actually
processed sufficiently to decide whether or not the system should
resume.  In turn, the ->sync hook allows all of the relevant event
queues to be flushed so as to prevent events from being missed due
to race conditions.

In addition to that, some ACPI code processing wakeup events needs
to be modified to use the "hard" version of wakeup triggers, so that
it will cause a system resume to happen on device-induced wakeup
events even if the "soft" mechanism to prevent the system from
suspending is not enabled.  However, to preserve the existing
behavior with respect to suspend-to-RAM, this only is done in
the suspend-to-idle case and only if an SCI has occurred while
suspended.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-06-15 00:55:44 +02:00
..
acpica ACPICA: Tables: Fix regression introduced by a too early mechanism enabling 2017-05-29 23:58:00 +02:00
apei treewide: use kv[mz]alloc* rather than opencoded variants 2017-05-08 17:15:13 -07:00
arm64 ACPI/IORT: Move the check to get iommu_ops from translated fwspec 2017-05-30 11:31:33 +02:00
dptf ACPI / platform: Add support for build-in properties 2016-11-10 00:30:29 +01:00
nfit acpi, nfit: Fix the memory error check in nfit_handle_mce() 2017-05-21 21:39:59 +02:00
pmic ACPI / PMIC: xpower: Fix power_table addresses 2017-04-28 23:32:44 +02:00
x86 ACPI / bus: Add INT0002 to list of always-present devices 2017-04-27 00:02:44 +02:00
ac.c ACPI / AC: Add a blacklist with PMIC ACPI HIDs with a native charger driver 2017-04-19 22:53:35 +02:00
acpi_amba.c
acpi_apd.c More ACPI updates for v4.12-rc1 2017-05-10 09:35:42 -07:00
acpi_cmos_rtc.c
acpi_configfs.c ACPI: Rename configfs.c to acpi_configfs.c to prevent link error 2016-07-11 15:13:36 +02:00
acpi_dbg.c
acpi_extlog.c EDAC: Rename report status accessors 2017-04-10 17:15:02 +02:00
acpi_ipmi.c ACPI / IPMI: change warning to debug on timeout 2017-04-07 12:25:37 -05:00
acpi_lpat.c ACPI / lpat: make it explicitly non-modular 2016-07-16 03:08:10 +02:00
acpi_lpss.c ACPI / LPSS: Call pwm_add_table() for Bay Trail PWM device 2017-04-28 23:31:22 +02:00
acpi_memhotplug.c
acpi_pad.c sched/headers: Prepare for new header dependencies before moving code to <uapi/linux/sched/types.h> 2017-03-02 08:42:27 +01:00
acpi_platform.c ACPI / platform: Update platform device NUMA node based on _PXM method 2017-04-18 16:56:39 +02:00
acpi_pnp.c
acpi_processor.c ACPI / Processor: Drop setup_max_cpus check from acpi_processor_add() 2017-04-18 16:50:24 +02:00
acpi_video.c ACPI / video: add comments about subtle cases 2017-04-19 22:50:11 +02:00
acpi_watchdog.c ACPI / watchdog: Print out error number when device creation fails 2016-12-26 23:21:56 +01:00
battery.c ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle 2017-06-15 00:55:44 +02:00
battery.h
bgrt.c efi/bgrt: Enable ACPI BGRT handling on arm64 2017-04-05 12:27:25 +02:00
blacklist.c ACPI / blacklist: add _REV quirk for Dell Inspiron 7537 2017-04-19 02:35:54 +02:00
bus.c ACPI / bus: Introduce a list of ids for "always present" devices 2017-04-27 00:02:43 +02:00
button.c ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle 2017-06-15 00:55:44 +02:00
cm_sbs.c
container.c
cppc_acpi.c scripts/spelling.txt: add regsiter -> register spelling mistake 2017-05-08 17:15:13 -07:00
custom_method.c
debugfs.c
device_pm.c ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle 2017-06-15 00:55:44 +02:00
device_sysfs.c ACPI / property: Hierarchical properties support update 2016-11-24 02:43:47 +01:00
dock.c ACPI / dock: make dock explicitly non-modular 2016-07-16 03:08:08 +02:00
ec_sys.c
ec.c ACPI / EC: Use busy polling mode when GPE is not enabled 2017-01-30 12:12:52 +01:00
event.c genetlink: mark families as __ro_after_init 2016-10-27 16:16:09 -04:00
evged.c
fan.c ACPI / fan: Fix error reading cur_state 2016-10-10 02:20:43 +02:00
glue.c IOMMU Updates for Linux v4.12 2017-05-09 15:15:47 -07:00
hed.c
internal.h ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle 2017-06-15 00:55:44 +02:00
ioapic.c ACPI: ioapic: Clear on-stack resource before using it 2017-03-28 23:31:45 +02:00
irq.c ACPI: Add support for ResourceSource/IRQ domain mapping 2017-02-03 15:03:48 +00:00
Kconfig - New Drivers 2017-05-03 12:16:25 -07:00
Makefile Merge branches 'acpi-soc', 'acpi-bus', 'acpi-pmic' and 'acpi-power' 2017-05-09 23:23:02 +02:00
numa.c ACPI/NUMA: Do not map pxm to node when NUMA is turned off 2016-12-15 11:32:32 +01:00
nvs.c
osi.c
osl.c ACPICA: Hardware: Add sleep register hooks 2017-01-02 23:18:41 +01:00
pci_irq.c ACPI / PCI: fix GIC irq model default PCI IRQ polarity 2016-09-10 02:50:50 +02:00
pci_link.c ACPI/PCI: pci_link: Include PIRQ_PENALTY_PCI_USING for ISA IRQs 2016-10-24 14:18:14 +02:00
pci_mcfg.c PCI/ACPI: Add ThunderX pass2.x 2nd node MCFG quirk 2017-04-24 11:58:56 -05:00
pci_root.c x86/ioapic: Split IOAPIC hot-removal into two steps 2017-03-01 10:51:41 +01:00
pci_slot.c ACPI / PCI: make pci_slot explicitly non-modular 2016-07-16 03:05:29 +02:00
power.c ACPI / power: Delay turning off unused power resources after suspend 2017-05-01 23:11:21 +02:00
proc.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
processor_core.c Revert"x86/acpi: Enable MADT APIs to return disabled apicids" 2017-03-11 14:41:18 +01:00
processor_driver.c ACPI/processor: Replace racy task affinity logic 2017-04-15 12:20:54 +02:00
processor_idle.c x86/amd: Simplify AMD E400 aware idle routine 2016-12-09 21:23:21 +01:00
processor_pdc.c
processor_perflib.c ACPI: processor_perflib: Simplify code and stop using CPUFREQ_START 2017-02-04 00:05:29 +01:00
processor_thermal.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
processor_throttling.c ACPI/processor: Replace racy task affinity logic 2017-04-15 12:20:54 +02:00
property.c device property: fwnode_property_read_string_array() returns nr of strings 2017-03-29 00:00:30 +02:00
reboot.c
resource.c scripts/spelling.txt: add "overrided" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
sbs.c
sbshc.c
sbshc.h
scan.c ACPI/IORT: Ignore all errors except EPROBE_DEFER 2017-05-30 11:31:32 +02:00
sleep.c ACPI / PM: Ignore spurious SCI wakeups from suspend-to-idle 2017-06-15 00:55:44 +02:00
sleep.h ACPI / power: Delay turning off unused power resources after suspend 2017-05-01 23:11:21 +02:00
spcr.c tty: acpi/spcr: QDF2400 E44 checks for wrong OEM revision 2017-03-14 10:48:54 +08:00
sysfs.c Merge branches 'acpi-button', 'acpica' and 'acpi-sysfs' 2017-06-03 00:03:29 +02:00
tables.c Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-05-01 20:51:12 -07:00
thermal.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
utils.c ACPI / utils: Add new acpi_dev_present helper 2017-04-19 22:53:34 +02:00
video_detect.c Revert "ACPI / video: Add force_native quirk for HP Pavilion dv6" 2017-01-25 14:04:13 +01:00
wakeup.c