From: Saranya Gopal <saranya.gopal@intel.com>
To: linux-acpi@vger.kernel.org
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
rafael.j.wysocki@intel.com
Subject: [PATCH] ACPI: s2idle: Add _Ixx GPE wake indicator support
Date: Fri, 4 Sep 2026 13:08:44 +0530 [thread overview]
Message-ID: <20260904073844.2740931-1-saranya.gopal@intel.com> (raw)
ACPI 6.6 defines _Ixx indicator objects under \_GPE to mark GPEs that
should remain wake-enabled in s2idle without a _PRW association.
To support them, add new function acpi_setup_ixx_gpes() that looks for
_Ixx objects for all GPEs in the FADT 0/1 blocks and if it finds any, it
marks the corresponding GPE as wake-capable, in which case the GPE is
also enabled so long as it has a handler method because marking it as
wake-capable causes acpi_update_all_gpes() to skip it. Since that only
needs to be done if suspend-to-idle is enabled, make acpi_s2idle_setup()
call that new function.
For now, this is limited to x86 systems and it assumes that the GPEs
with _Ixx will not cause spurious wakeups to occur while suspended.
Signed-off-by: Saranya Gopal <saranya.gopal@intel.com>
---
drivers/acpi/x86/s2idle.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index b6b1dd76a06b..ac49f9e75fae 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -24,6 +24,31 @@
#ifdef CONFIG_SUSPEND
+static void acpi_setup_ixx_gpes(void)
+{
+ acpi_handle gpe_root;
+ unsigned int i;
+ char gpe_nr_str[5];
+
+ if (ACPI_FAILURE(acpi_get_handle(NULL, "\\_GPE", &gpe_root)))
+ return;
+
+ for (i = 0; i <= 0xff; i++) {
+ scnprintf(gpe_nr_str, sizeof(gpe_nr_str), "_I%02X", i);
+ if (!acpi_has_method(gpe_root, gpe_nr_str))
+ continue;
+ /*
+ * Enable the GPE if it has a handler method because marking it
+ * as wake-capable causes acpi_update_all_gpes() to skip it.
+ */
+ if (ACPI_FAILURE(acpi_enable_gpe_cond(NULL, i, ACPI_GPE_DISPATCH_METHOD)))
+ continue;
+ acpi_mark_gpe_for_wake(NULL, i);
+ acpi_set_gpe_wake_mask(NULL, i, ACPI_GPE_ENABLE);
+ pm_pr_dbg("ACPI: GPE 0x%02x armed for wake via %s\n", i, gpe_nr_str);
+ }
+}
+
static bool sleep_no_lps0 __read_mostly;
module_param(sleep_no_lps0, bool, 0644);
MODULE_PARM_DESC(sleep_no_lps0, "Do not use the special LPS0 device interface");
@@ -649,6 +674,7 @@ void __init acpi_s2idle_setup(void)
{
acpi_scan_add_handler(&lps0_handler);
s2idle_set_ops(&acpi_s2idle_ops_lps0);
+ acpi_setup_ixx_gpes();
}
int acpi_register_lps0_dev(struct acpi_s2idle_dev_ops *arg)
--
2.34.1
reply other threads:[~2026-09-04 7:38 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260904073844.2740931-1-saranya.gopal@intel.com \
--to=saranya.gopal@intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@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