From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: Linux PM <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
David Box <david.e.box@linux.intel.com>,
Chen Yu <yu.c.chen@intel.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Tsuchiya Yuto <kitakar@gmail.com>,
Bob Moore <robert.moore@intel.com>,
Erik Kaneda <erik.kaneda@intel.com>
Subject: [PATCH 2/2] ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system
Date: Tue, 11 Feb 2020 17:53:52 +0100 [thread overview]
Message-ID: <7099853.cFaFQmLQCt@kreacher> (raw)
In-Reply-To: <6974889.tv0o8xEHfr@kreacher>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
If the platform triggers a spurious SCI even though the status bit
is not set for any GPE when the system is suspended to idle, it will
be treated as a genuine wakeup, so avoid that by checking if any GPEs
are active at all before returning 'true' from acpi_s2idle_wake().
Link: https://bugzilla.kernel.org/show_bug.cgi?id=206413
Fixes: 56b991849009 ("PM: sleep: Simplify suspend-to-idle control flow")
Reported-by: Tsuchiya Yuto <kitakar@gmail.com>
Cc: 5.4+ <stable@vger.kernel.org> # 5.4+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/sleep.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
Index: linux-pm/drivers/acpi/sleep.c
===================================================================
--- linux-pm.orig/drivers/acpi/sleep.c
+++ linux-pm/drivers/acpi/sleep.c
@@ -1006,10 +1006,16 @@ static bool acpi_s2idle_wake(void)
return true;
/*
- * If there are no EC events to process, the wakeup is regarded
- * as a genuine one.
+ * If there are no EC events to process and at least one of the
+ * other enabled GPEs is active, the wakeup is regarded as a
+ * genuine one.
+ *
+ * Note that the checks below must be carried out in this order
+ * to avoid returning prematurely due to a change of the EC GPE
+ * status bit from unset to set between the checks with the
+ * status bits of all the other GPEs unset.
*/
- if (!acpi_ec_dispatch_gpe())
+ if (acpi_any_gpe_status_set() && !acpi_ec_dispatch_gpe())
return true;
/*
prev parent reply other threads:[~2020-02-11 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 16:51 [PATCH 0/2] ACPI: PM: s2idle: Prevent spurious SCIs from waking up the system Rafael J. Wysocki
2020-02-11 16:52 ` [PATCH 1/2] ACPICA: Introduce acpi_any_gpe_status_set() Rafael J. Wysocki
2020-02-11 16:53 ` Rafael J. Wysocki [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7099853.cFaFQmLQCt@kreacher \
--to=rjw@rjwysocki.net \
--cc=david.e.box@linux.intel.com \
--cc=erik.kaneda@intel.com \
--cc=kitakar@gmail.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=rui.zhang@intel.com \
--cc=yu.c.chen@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).