android_kernel_motorola_sm6375/kernel/power
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Rafael J. Wysocki 0671627a5f ACPI: PM: s2idle: Avoid possible race related to the EC GPE
commit e3728b50cd9be7d4b1469447cdf1feb93e3b7adb upstream.

It is theoretically possible for the ACPI EC GPE to be set after the
s2idle_ops->wake() called from s2idle_loop() has returned and before
the subsequent pm_wakeup_pending() check is carried out.  If that
happens, the resulting wakeup event will cause the system to resume
even though it may be a spurious one.

To avoid that race, first make the ->wake() callback in struct
platform_s2idle_ops return a bool value indicating whether or not
to let the system resume and rearrange s2idle_loop() to use that
value instad of the direct pm_wakeup_pending() call if ->wake() is
present.

Next, rework acpi_s2idle_wake() to process EC events and check
pm_wakeup_pending() before re-arming the SCI for system wakeup
to prevent it from triggering prematurely and add comments to
that function to explain the rationale for the new code flow.

Fixes: 56b9918490 ("PM: sleep: Simplify suspend-to-idle control flow")
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>
2020-02-19 19:52:56 +01:00
..
autosleep.c
console.c
energy_model.c
hibernate.c
Kconfig
main.c PM: sleep: include <linux/pm_runtime.h> for pm_wq 2019-10-10 11:11:56 +02:00
Makefile
power.h
poweroff.c
process.c
qos.c PM: QoS: Invalidate frequency QoS requests after removal 2019-11-20 10:46:42 +01:00
snapshot.c PM: hibernate: fix crashes with init_on_free=1 2020-01-29 16:45:25 +01:00
suspend.c ACPI: PM: s2idle: Avoid possible race related to the EC GPE 2020-02-19 19:52:56 +01:00
suspend_test.c
swap.c
user.c
wakelock.c