From: Bartu Alev <bartualev@gmail.com>
To: "Corentin Chary" <corentin.chary@gmail.com>,
"Luke D. Jones" <luke@ljones.dev>,
"Denis Benato" <denis.benato@linux.dev>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"Antheas Kapenekakis" <lkml@antheas.dev>,
"Benjamin Tissoires" <bentiss@kernel.org>
Cc: Denis Benato <benato.denis96@gmail.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, Bartu Alev <bartualev@gmail.com>,
stable@vger.kernel.org
Subject: [PATCH 0/2] platform/x86: asus-wmi: fix and unify keyboard brightness key handling
Date: Sun, 25 Oct 2026 21:29:35 +0300 [thread overview]
Message-ID: <20261025-b4-asus-kbd-fixes-v1-0-fa4dcf7d2a69@gmail.com> (raw)
The WMI hotkey path and the HID event path in asus-wmi step the
keyboard backlight with two separate copies of the same arithmetic, and
the two copies disagree. The WMI copy stores the new level without
clamping it, so holding brightness-down at zero drives the cached level
one step below zero per keypress, the "value >= 0" apply check then
drops every following transition, and the hardware-changed notification
hands the wrapped negative to userspace as 4294967294+. Pressing
brightness-up at maximum reports 4, above max_brightness.
The first patch fixes the bounds on its own, so stable trees can pick
it up without the rest of the series. The second patch removes the
duplication: both paths now step through one shared helper that reads,
computes, and writes the level inside a single hold of asus_ref.lock.
With the series applied the level stays
within [0, ASUS_EV_MAX_BRIGHTNESS] on every transition and userspace
sees no wrapped or out-of-range values.
Signed-off-by: Bartu Alev <bartualev@gmail.com>
---
Bartu Alev (2):
platform/x86: asus-wmi: clamp keyboard brightness hotkey updates
platform/x86: asus-wmi: unify WMI and HID keyboard brightness stepping
drivers/platform/x86/asus-wmi.c | 79 +++++++++++++++++++++--------------------
1 file changed, 40 insertions(+), 39 deletions(-)
---
base-commit: 9d3475065167197742b0882aff21cf8e78393277
change-id: 20261025-b4-asus-kbd-fixes-6c7e3780597b
Best regards,
--
Bartu Alev <bartualev@gmail.com>
next reply other threads:[~2026-10-25 18:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-25 18:29 Bartu Alev [this message]
2026-10-25 18:29 ` [PATCH 1/2] platform/x86: asus-wmi: clamp keyboard brightness hotkey updates Bartu Alev
2026-10-25 18:29 ` [PATCH 2/2] platform/x86: asus-wmi: unify WMI and HID keyboard brightness stepping Bartu Alev
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=20261025-b4-asus-kbd-fixes-v1-0-fa4dcf7d2a69@gmail.com \
--to=bartualev@gmail.com \
--cc=benato.denis96@gmail.com \
--cc=bentiss@kernel.org \
--cc=corentin.chary@gmail.com \
--cc=denis.benato@linux.dev \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@antheas.dev \
--cc=luke@ljones.dev \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®