android_kernel_motorola_sm6375/drivers/base
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rafael J. Wysocki b55a0cdbec PM: s2idle: ACPI: Fix wakeup interrupts handling
commit cb1f65c1e1424a4b5e4a86da8aa3b8fd8459c8ec upstream.

After commit e3728b50cd9b ("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: e3728b50cd9b ("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:52:50 +01:00
..
firmware_loader drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
power PM: s2idle: ACPI: Fix wakeup interrupts handling 2022-02-16 12:52:50 +01:00
regmap regmap: Fix possible double-free in regcache_rbtree_exit() 2021-11-02 19:46:13 +01:00
test
arch_topology.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
attribute_container.c
base.h
bus.c
cacheinfo.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
class.c
component.c
container.c
core.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
cpu.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
dd.c driver core: Fix locking bug in deferred_probe_timeout_work_func() 2021-04-16 11:46:38 +02:00
devcon.c
devcoredump.c
devres.c
devtmpfs.c devtmpfs regression fix: reconfigure on each mount 2022-01-20 09:19:17 +01:00
driver.c
firmware.c
hypervisor.c
init.c
isa.c
Kconfig
Makefile
map.c
memory.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
module.c
node.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
pinctrl.c
platform-msi.c
platform.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
property.c
soc.c drivers core: Use sysfs_emit and sysfs_emit_at for show(device *...) functions 2022-01-16 09:15:38 +01:00
swnode.c
syscore.c
topology.c
transport_class.c