kernel_optimize_test/drivers/base
Rafael J. Wysocki a941384fba PM: s2idle: ACPI: Fix wakeup interrupts handling
commit cb1f65c1e1424a4b5e4a86da8aa3b8fd8459c8ec upstream.

After commit e3728b50cd ("ACPI: PM: s2idle: Avoid possible race
related to the EC GPE") wakeup interrupts occurring immediately after
the one discarded by acpi_s2idle_wake() may be missed.  Moreover, if
the SCI triggers again immediately after the rearming in
acpi_s2idle_wake(), that wakeup may be missed too.

The problem is that pm_system_irq_wakeup() only calls pm_system_wakeup()
when pm_wakeup_irq is 0, but that's not the case any more after the
interrupt causing acpi_s2idle_wake() to run until pm_wakeup_irq is
cleared by the pm_wakeup_clear() call in s2idle_loop().  However,
there may be wakeup interrupts occurring in that time frame and if
that happens, they will be missed.

To address that issue first move the clearing of pm_wakeup_irq to
the point at which it is known that the interrupt causing
acpi_s2idle_wake() to tun will be discarded, before rearming the SCI
for wakeup.  Moreover, because that only reduces the size of the
time window in which the issue may manifest itself, allow
pm_system_irq_wakeup() to register two second wakeup interrupts in
a row and, when discarding the first one, replace it with the second
one.  [Of course, this assumes that only one wakeup interrupt can be
discarded in one go, but currently that is the case and I am not
aware of any plans to change that.]

Fixes: e3728b50cd ("ACPI: PM: s2idle: Avoid possible race related to the EC GPE")
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-16 12:54:22 +01:00
..
firmware_loader firmware_loader: fix pre-allocated buf built-in firmware use 2021-11-26 10:39:10 +01:00
power PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-16 12:54:22 +01:00
regmap regmap: Call regmap_debugfs_exit() prior to _init() 2022-01-27 10:54:03 +01:00
test drivers/base: build kunit tests without structleak plugin 2021-03-17 17:06:24 +01:00
arch_topology.c Driver Core patches for 5.10-rc1 2020-10-14 16:09:32 -07:00
attribute_container.c
base.h driver core: add deferring probe reason to devices_deferred property 2020-07-30 09:03:43 +02:00
bus.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
cacheinfo.c drivers core: Use sysfs_emit for shared_cpu_map_show and shared_cpu_list_show 2020-10-02 13:24:40 +02:00
class.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
component.c
container.c
core.c PM: runtime: Add safety net to supplier device release 2022-01-27 10:54:17 +01:00
cpu.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
dd.c driver core: Fix error return code in really_probe() 2021-09-15 09:50:33 +02:00
devcoredump.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
devres.c devres: provide devm_krealloc() 2020-09-08 13:32:06 +02:00
devtmpfs.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:17:49 +01:00
driver.c drivers: base: Convert to printk alias functions 2020-07-10 14:16:44 +02:00
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile device property: Move fwnode_connection_find_match() under drivers/base/property.c 2020-09-08 13:32:06 +02:00
map.c
memory.c drivers/base/memory: don't store phys_device in memory blocks 2021-03-17 17:06:25 +01:00
module.c
node.c node: fix device cleanups in error handling code 2021-05-14 09:50:19 +02:00
pinctrl.c
platform-msi.c
platform.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
property.c device property: Fix fwnode_graph_devcon_match() fwnode leak 2022-01-27 10:54:25 +01:00
soc.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
swnode.c software node: fix wrong node passed to find nargs_prop 2022-01-27 10:53:59 +01:00
syscore.c syscore: Use pm_pr_dbg() for syscore_{suspend,resume}() 2020-09-08 13:32:06 +02:00
topology.c drivers core: Miscellaneous changes for sysfs_emit 2020-10-02 13:12:07 +02:00
transport_class.c