Skip to contentSkip to conversation

ACPI: button: Only send `KEY_POWER` for `ACPI_BUTTON_NOTIFY_STATUS`

PATCH Applied Mario Limonciello 3 participants 3 messages Apr 4, 2025 – Apr 7, 2025 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ACPI: button: Only send `KEY_POWER` for `ACPI_BUTTON_NOTIFY_STATUS`

From: Mario Limonciello <[email protected]>

commit a7e23ec17feec ("ACPI: button: Install notifier for system events as well") modified the ACPI button behavior to send ACPI_BUTTON_NOTIFY_WAKE events. This caused a regression on a "Dell Optiplex 3040" sending KEY_POWER randomly at runtime.

Adjust logic so that the event ACPI_BUTTON_NOTIFY_WAKE will never send KEY_POWER.

---
Cc: Yijun Shen <[email protected]>
Cc: Richard Gong <[email protected]>

v2:
* Handle logic change for avoiding KEY_POWER all the time

---
 drivers/acpi/button.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/button.c +1 -1
index 90b09840536dd..0a70260401882 100644
@@ -458,7 +458,7 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)
 	acpi_pm_wakeup_event(&device->dev);
 
 	button = acpi_driver_data(device);
-	if (button->suspended)
+	if (button->suspended || event == ACPI_BUTTON_NOTIFY_WAKE)
 		return;
 
 	input = button->input;
Signature · 1 line
2.43.0
Tested-by on v2 1/1
#1 lore raw

Downloaded the build Justin did on Koji, looks good after 24 hours, no bugus events.

--
Ian Laurie
FAS: nixuser | IRC: nixuser
TZ: Australia/Sydney