]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.35/acpica-clear-status-of-gpes-before-enabling-them.patch
Linux 4.19.35
[thirdparty/kernel/stable-queue.git] / releases / 4.19.35 / acpica-clear-status-of-gpes-before-enabling-them.patch
CommitLineData
948f2681
GKH
1From c8b1917c8987a6fa3695d479b4d60fbbbc3e537b Mon Sep 17 00:00:00 2001
2From: Furquan Shaikh <furquan@google.com>
3Date: Wed, 20 Mar 2019 15:28:44 -0700
4Subject: ACPICA: Clear status of GPEs before enabling them
5
6From: Furquan Shaikh <furquan@google.com>
7
8commit c8b1917c8987a6fa3695d479b4d60fbbbc3e537b upstream.
9
10Commit 18996f2db918 ("ACPICA: Events: Stop unconditionally clearing
11ACPI IRQs during suspend/resume") was added to stop clearing event
12status bits unconditionally in the system-wide suspend and resume
13paths. This was done because of an issue with a laptop lid appaering
14to be closed even when it was used to wake up the system from suspend
15(see https://bugzilla.kernel.org/show_bug.cgi?id=196249), which
16happened because event status bits were cleared unconditionally on
17system resume. Though this change fixed the issue in the resume path,
18it introduced regressions in a few suspend paths.
19
20First regression was reported and fixed in the S5 entry path by commit
21fa85015c0d95 ("ACPICA: Clear status of all events when entering S5").
22Next regression was reported and fixed for all legacy sleep paths by
23commit f317c7dc12b7 ("ACPICA: Clear status of all events when entering
24sleep states"). However, there still is a suspend-to-idle regression,
25since suspend-to-idle does not follow the legacy sleep paths.
26
27In the suspend-to-idle case, wakeup is enabled as part of device
28suspend. If the status bits of wakeup GPEs are set when they are
29enabled, it causes a premature system wakeup to occur.
30
31To address that problem, partially revert commit 18996f2db918 to
32restore GPE status bits clearing before the GPE is enabled in
33acpi_ev_enable_gpe().
34
35Fixes: 18996f2db918 ("ACPICA: Events: Stop unconditionally clearing ACPI IRQs during suspend/resume")
36Signed-off-by: Furquan Shaikh <furquan@google.com>
37Cc: 4.17+ <stable@vger.kernel.org> # 4.17+
38[ rjw: Subject & changelog ]
39Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
40Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
41
42---
43 drivers/acpi/acpica/evgpe.c | 6 +++++-
44 1 file changed, 5 insertions(+), 1 deletion(-)
45
46--- a/drivers/acpi/acpica/evgpe.c
47+++ b/drivers/acpi/acpica/evgpe.c
48@@ -81,8 +81,12 @@ acpi_status acpi_ev_enable_gpe(struct ac
49
50 ACPI_FUNCTION_TRACE(ev_enable_gpe);
51
52- /* Enable the requested GPE */
53+ /* Clear the GPE status */
54+ status = acpi_hw_clear_gpe(gpe_event_info);
55+ if (ACPI_FAILURE(status))
56+ return_ACPI_STATUS(status);
57
58+ /* Enable the requested GPE */
59 status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_ENABLE);
60 return_ACPI_STATUS(status);
61 }