From: Mario Limonciello <superm1@kernel.org>
To: mario.limonciello@amd.com, rafael@kernel.org
Cc: Ian Laurie <nixuser@mail.com>, Yijun Shen <yijun_shen@dell.com>,
Richard Gong <richard.gong@amd.com>,
rafael.j.wysocki@intel.com, linux-acpi@vger.kernel.org
Subject: [PATCH v2] ACPI: button: Only send `KEY_POWER` for `ACPI_BUTTON_NOTIFY_STATUS`
Date: Fri, 4 Apr 2025 09:50:22 -0500 [thread overview]
Message-ID: <20250404145034.2608574-1-superm1@kernel.org> (raw)
From: Mario Limonciello <mario.limonciello@amd.com>
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`.
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>
---
Cc: Yijun Shen <yijun_shen@dell.com>
Cc: Richard Gong <richard.gong@amd.com>
v2:
* Handle logic change for avoiding KEY_POWER all the time
---
drivers/acpi/button.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index 90b09840536dd..0a70260401882 100644
--- a/drivers/acpi/button.c
+++ b/drivers/acpi/button.c
@@ -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;
--
2.43.0
next reply other threads:[~2025-04-04 14:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 14:50 Mario Limonciello [this message]
2025-04-07 2:13 ` [PATCH v2] ACPI: button: Only send `KEY_POWER` for `ACPI_BUTTON_NOTIFY_STATUS` Ian Laurie
2025-04-07 17:55 ` Rafael J. Wysocki
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=20250404145034.2608574-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=nixuser@mail.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=richard.gong@amd.com \
--cc=yijun_shen@dell.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