]> git.ipfire.org Git - thirdparty/linux.git/commit
ACPI: button: Enable wakeup GPEs for ACPI buttons at probe time
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 22 May 2026 14:52:10 +0000 (16:52 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 May 2026 07:52:34 +0000 (09:52 +0200)
commita004b8f0d3bc5d82d3f2c91ff93f4b4b7ccb8f76
tree5bc42826ad1b56ce0b4b4202b22ddafd773d4545
parentfe80251152fed5b185f795ef2cd9f7fe9c3162e0
ACPI: button: Enable wakeup GPEs for ACPI buttons at probe time

Prior to commit 57c31e6d620f ("ACPI: scan: Use acpi_setup_gpe_for_wake()
for buttons"), ACPI button wakeup GPEs having handler methods remained
enabled after acpi_wakeup_gpe_init(), but currently they are not enabled
because acpi_setup_gpe_for_wake() disables them.

That causes function keys to stop working on some systems [1] and there
may be other related issues elsewhere.

To address that, make the ACPI button driver enable wakeup GPEs for ACPI
buttons so long as they have handler methods.  While this does not
restore the old behavior exactly (the ACPI button driver needs to be
bound to the button devices for the GPEs to be enabled), it should be
sufficient to restore the missing functionality.

For this purpose, introduce acpi_enable_gpe_cond() that enables
a GPE if its dispatch type matches the supplied one and modify
acpi_button_probe() to use that function for enabling the GPEs in
question.

Fixes: 57c31e6d620f ("ACPI: scan: Use acpi_setup_gpe_for_wake() for buttons")
Reported-by: Nick <nick@kousu.ca>
Closes: https://lore.kernel.org/linux-acpi/E2OXET.4X5GTP37VTNC3@kousu.ca/ [1]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Nick <nick@kousu.ca>
Cc: 7.0+ <stable@vger.kernel.org> # 7.0+
Link: https://patch.msgid.link/9629117.CDJkKcVGEf@rafael.j.wysocki
drivers/acpi/acpica/evxfgpe.c
drivers/acpi/button.c
include/acpi/acpixf.h