Re: [PATCH v3] platform/asus: asus-wmi: Skip keyboard backlight read-back on B9406CAA

From: Ilpo Järvinen

Date: Wed Nov 25 2026 - 18:48:27 EST


On Mon, 23 Nov 2026, Sercan GOKMEN wrote:

> On the ASUS ExpertBook Ultra B9406CAA (BIOS 312), DSTS(0x00050021)
> always returns 0x550000: the presence bit is set and the level is 0,
> whatever level the EC is driving. The DSDT builds this reply from
> constants and never reads the EC. Writes work.
>
> kbd_led_get() stores every read in asus->kbd_led_wk, so each sysfs read
> resets the cached level to 0. sysfs, UPower and brightnessctl then
> report 0, systemd-backlight restores a dark keyboard at boot, and the
> next Fn backlight key press always gives level 1.
>
> Add a kbd_led_no_readback quirk that makes kbd_led_get() return the
> cached level, as the !kbd_led_avail path already does, and set it for
> this board. Every path that changes the level keeps kbd_led_wk current.
> Until the first write after probe, the driver still reports the 0 it
> read at probe time.
>
> Signed-off-by: Sercan GOKMEN <gokmensercan@xxxxxxxxx>
> ---
> Tested on the B9406CAA (BIOS 312) on Linux 7.2.3: brightness reads back
> the level written to it, UPower reports the same value, and the Fn
> backlight key steps 2 -> 3 -> 0 -> 1 from level 2. On 7.3.0 and 7.3.5,
> with the same change built as a DKMS module, writes of 3/1/0/2 read back
> unchanged.
> Build-tested on review-ilpo-next (2268d837dea1) with W=1 (clang).
>
> This conflicts trivially with Moad Tarrih's G814FP patch, which adds a
> quirk_entry field and a DMI entry at the same places:
> https://lore.kernel.org/r/20261116-asus-wmi-kbd-readback-v5-1-f2f170836bf4@xxxxxxxxx
> Applied after it, only asus-nb-wmi.c needs the two entries merged.

Hi,

I applied to other patch to the review-ilpo-next branch (will eventually
propagate into for-next once LKP's build test given green light).

The naming seems different, so can you please do v4 on top of the
review-ilpo-next branch.

--
i.

> The patch was prepared with the help of an AI coding assistant (Claude
> Code). I reviewed it and tested it on the hardware.
> ---
> Changes in v3:
> - Rebase onto review-ilpo-next, after the move to drivers/platform/asus/,
> and use the platform/asus prefix.
> - Trim the commit message.
> - Drop the comment on the quirk_entry field and shorten the one on the
> quirk.
> - Link to v2: https://patch.msgid.link/20261030-b4-asus-wmi-b9406caa-kbd-readback-v2-1-ca93bb9039f6@xxxxxxxxx
>
> Changes in v2:
> - Shorten the subject (Burak Goncu).
> - Say that kbd_led_wk keeps the 0 read at probe until the first write
> (Burak Goncu).
> - Move the test details below the cut (Burak Goncu).
> - Rebase on current for-next.
> - Link to v1: https://patch.msgid.link/20261022-b4-asus-wmi-b9406caa-kbd-readback-v1-1-fb33ed98dd16@xxxxxxxxx
> ---
> drivers/platform/asus/asus-nb-wmi.c | 15 +++++++++++++++
> drivers/platform/asus/asus-wmi.c | 3 ++-
> drivers/platform/asus/asus-wmi.h | 1 +
> 3 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
> index 3b0f3346dc..420fdced34 100644
> --- a/drivers/platform/asus/asus-nb-wmi.c
> +++ b/drivers/platform/asus/asus-nb-wmi.c
> @@ -93,6 +93,12 @@ static struct quirk_entry quirk_asus_unknown = {
> .wmi_backlight_set_devstate = true,
> };
>
> +/* B9406CAA: DSTS(0x00050021) always reports level 0 */
> +static struct quirk_entry quirk_asus_b9406caa = {
> + .wmi_backlight_set_devstate = true,
> + .kbd_led_no_readback = true,
> +};
> +
> static struct quirk_entry quirk_asus_q500a = {
> .filter_i8042_e1_extended_codes = true,
> .wmi_backlight_set_devstate = true,
> @@ -167,6 +173,15 @@ static int dmi_matched(const struct dmi_system_id *dmi)
> }
>
> static const struct dmi_system_id asus_quirks[] = {
> + {
> + .callback = dmi_matched,
> + .ident = "ASUS ExpertBook Ultra B9406CAA",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "ASUS"),
> + DMI_MATCH(DMI_BOARD_NAME, "B9406CAA"),
> + },
> + .driver_data = &quirk_asus_b9406caa,
> + },
> {
> .callback = dmi_matched,
> .ident = "ASUSTeK COMPUTER INC. Q500A",
> diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
> index b33ebdb21a..725f827a17 100644
> --- a/drivers/platform/asus/asus-wmi.c
> +++ b/drivers/platform/asus/asus-wmi.c
> @@ -1975,7 +1975,8 @@ static enum led_brightness kbd_led_get(struct led_classdev *led_cdev)
> asus = container_of(led_cdev, struct asus_wmi, kbd_led);
>
> scoped_guard(spinlock_irqsave, &asus_ref.lock) {
> - if (!asus->kbd_led_avail)
> + if (!asus->kbd_led_avail ||
> + asus->driver->quirks->kbd_led_no_readback)
> return asus->kbd_led_wk;
> }
>
> diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
> index b45f81b38a..72a43586ff 100644
> --- a/drivers/platform/asus/asus-wmi.h
> +++ b/drivers/platform/asus/asus-wmi.h
> @@ -52,6 +52,7 @@ struct quirk_entry {
> */
> int no_display_toggle;
> u32 xusb2pr;
> + bool kbd_led_no_readback;
> };
>
> struct asus_wmi_driver {
>
> ---
> base-commit: 2268d837dea13a78639fa3dad60472bb67478709
> change-id: 20261022-b4-asus-wmi-b9406caa-kbd-readback-aed82953d839
>
> Best regards,
> --
> Sercan GOKMEN <gokmensercan@xxxxxxxxx>
>