mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] platform/x86: asus-wmi: fix and unify keyboard brightness key handling
@ 2026-10-25 18:29 Bartu Alev
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Bartu Alev @ 2026-10-25 18:29 UTC (permalink / raw)
  To: Corentin Chary, Luke D. Jones, Denis Benato, Hans de Goede,
	Ilpo Järvinen, Antheas Kapenekakis, Benjamin Tissoires
  Cc: Denis Benato, platform-driver-x86, linux-kernel, Bartu Alev, stable

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>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-25 18:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25 18:29 [PATCH 0/2] platform/x86: asus-wmi: fix and unify keyboard brightness key handling Bartu Alev
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

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®