[PATCH v3 0/3] platform/x86: dell-laptop: Fix keyboard backlight and charge threshold handling

From: Rosen Penev

Date: Wed Nov 25 2026 - 18:21:36 EST


Three fixes for dell-laptop: keyboard backlight timeouts that overflow
during unit conversion were silently accepted, an unread keyboard state
was used at init when the SMBIOS call failed, and the charge end
threshold was parsed with kstrtouint() into an int.

These patches were developed with the help of an AI coding assistant
(Claude Opus 5.5): it reviewed the drivers, found the issues and drafted
the fixes and changelogs. I reviewed every change and I am responsible
for them.

All patches build cleanly with W=1.

Tested on a Dell Precision M4800 running v7.2.15, using the equivalent
backports built as out-of-tree modules:
- writing 4424214d / 18989323d to stop_timeout set 4m / 2m before
patch 1 and is rejected with -EINVAL after it; 5m still works
(v1 of patch 1; v2 is compile-tested only)
- charge_control_end_threshold rejects -1 and 101, accepts 85
(v1 and v2 of patch 3; v3 is compile-tested only)
The kbd_get_state() failure path of patch 2 was not triggered.

Changes in v3:
- patch 3: make end unsigned int and drop the dead "< 0" check
instead of switching to kstrtoint(); retitled (review feedback)
v2: https://lore.kernel.org/r/cover.1795219225.git.rosenp@xxxxxxxxx

Changes in v2:
- patch 1: convert to a u64 seconds value instead of failing
check_mul_overflow() on the int, so the unit selection below works
on the full value; retitled (review feedback)
- patch 2: don't fail kbd_init_info() when kbd_get_state() fails;
fall back to level 0 / off mode so the existing code picks sane
defaults (review feedback)
v1: https://lore.kernel.org/r/cover.1794633179.git.rosenp@xxxxxxxxx


Rosen Penev (3):
platform/x86: dell-laptop: Fix keyboard backlight timeout overflow
platform/x86: dell-laptop: Don't use an unread keyboard state at init
platform/x86: dell-laptop: Make the charge end threshold unsigned

drivers/platform/x86/dell/dell-laptop.c | 50 +++++++++++++++----------
1 file changed, 31 insertions(+), 19 deletions(-)

--
2.56.1