]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ACPI: button: Only send `KEY_POWER` for `ACPI_BUTTON_NOTIFY_STATUS`
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 4 Apr 2025 14:50:22 +0000 (09:50 -0500)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Apr 2025 17:52:17 +0000 (19:52 +0200)
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 Dell Optiplex 3040 sending `KEY_POWER`
randomly at runtime.

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

Fixes: a7e23ec17feec ("ACPI: button: Install notifier for system events as well")
Reported-by: Ian Laurie <nixuser@mail.com>
Closes: https://lore.kernel.org/linux-acpi/CAJZ5v0hbA6bqxHupTh4NZR-GVSb9M5RL7JSb2yQgvYYJg+z2aQ@mail.gmail.com/T/#md8071e480212201f23e4929607386750d3b6bc13
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2357044
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Tested-by: Ian Laurie <nixuser@mail.com>
Link: https://patch.msgid.link/20250404145034.2608574-1-superm1@kernel.org
[ rjw: Changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/button.c

index 90b09840536dde1771cfe6a568edebcc0917d96f..0a7026040188253dd422d264886cc79071c55d76 100644 (file)
@@ -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;