* [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led
@ 2025-11-29 10:13 Anton Khirnov
2025-11-29 13:32 ` Andy Shevchenko
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Anton Khirnov @ 2025-11-29 10:13 UTC (permalink / raw)
To: Corentin Chary, Luke D. Jones, Denis Benato, Hans de Goede,
Ilpo Järvinen, Andy Shevchenko, Jian-Hong Pan
Cc: anton, platform-driver-x86, linux-kernel
kbd_led_set() can sleep, and so may not be used as the brightness_set()
callback.
Otherwise using this led with a trigger leads to system hangs
accompanied by:
BUG: scheduling while atomic: acpi_fakekeyd/2588/0x00000003
CPU: 4 UID: 0 PID: 2588 Comm: acpi_fakekeyd Not tainted 6.17.9+deb14-amd64 #1 PREEMPT(lazy) Debian 6.17.9-1
Hardware name: ASUSTeK COMPUTER INC. ASUS EXPERTBOOK B9403CVAR/B9403CVAR, BIOS B9403CVAR.311 12/24/2024
Call Trace:
<TASK>
[...]
schedule_timeout+0xbd/0x100
__down_common+0x175/0x290
down_timeout+0x67/0x70
acpi_os_wait_semaphore+0x57/0x90
[...]
asus_wmi_evaluate_method3+0x87/0x190 [asus_wmi]
led_trigger_event+0x3f/0x60
[...]
Fixes: 9fe44fc98ce4 ("platform/x86: asus-wmi: Simplify the keyboard brightness updating process")
Signed-off-by: Anton Khirnov <anton@khirnov.net>
---
v2:
- reworded commit message, adding traceback
- merged lines in kbd_led_set() signature
---
drivers/platform/x86/asus-wmi.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
index e72a2b5d158e..8e3300f5c294 100644
--- a/drivers/platform/x86/asus-wmi.c
+++ b/drivers/platform/x86/asus-wmi.c
@@ -1619,14 +1619,14 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
kbd_led_update(asus);
}
-static void kbd_led_set(struct led_classdev *led_cdev,
- enum led_brightness value)
+static int kbd_led_set(struct led_classdev *led_cdev, enum led_brightness value)
{
/* Prevent disabling keyboard backlight on module unregister */
if (led_cdev->flags & LED_UNREGISTERING)
- return;
+ return 0;
do_kbd_led_set(led_cdev, value);
+ return 0;
}
static void kbd_led_set_by_kbd(struct asus_wmi *asus, enum led_brightness value)
@@ -1802,7 +1802,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
asus->kbd_led_wk = led_val;
asus->kbd_led.name = "asus::kbd_backlight";
asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
- asus->kbd_led.brightness_set = kbd_led_set;
+ asus->kbd_led.brightness_set_blocking = kbd_led_set;
asus->kbd_led.brightness_get = kbd_led_get;
asus->kbd_led.max_brightness = 3;
--
2.47.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led
2025-11-29 10:13 [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led Anton Khirnov
@ 2025-11-29 13:32 ` Andy Shevchenko
2025-11-29 13:54 ` Denis Benato
2025-12-03 9:47 ` Ilpo Järvinen
2 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2025-11-29 13:32 UTC (permalink / raw)
To: Anton Khirnov
Cc: Corentin Chary, Luke D. Jones, Denis Benato, Hans de Goede,
Ilpo Järvinen, Jian-Hong Pan, platform-driver-x86,
linux-kernel
On Sat, Nov 29, 2025 at 11:13:08AM +0100, Anton Khirnov wrote:
> kbd_led_set() can sleep, and so may not be used as the brightness_set()
> callback.
>
> Otherwise using this led with a trigger leads to system hangs
> accompanied by:
> BUG: scheduling while atomic: acpi_fakekeyd/2588/0x00000003
> CPU: 4 UID: 0 PID: 2588 Comm: acpi_fakekeyd Not tainted 6.17.9+deb14-amd64 #1 PREEMPT(lazy) Debian 6.17.9-1
> Hardware name: ASUSTeK COMPUTER INC. ASUS EXPERTBOOK B9403CVAR/B9403CVAR, BIOS B9403CVAR.311 12/24/2024
> Call Trace:
> <TASK>
> [...]
> schedule_timeout+0xbd/0x100
> __down_common+0x175/0x290
> down_timeout+0x67/0x70
> acpi_os_wait_semaphore+0x57/0x90
> [...]
> asus_wmi_evaluate_method3+0x87/0x190 [asus_wmi]
> led_trigger_event+0x3f/0x60
> [...]
FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led
2025-11-29 10:13 [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led Anton Khirnov
2025-11-29 13:32 ` Andy Shevchenko
@ 2025-11-29 13:54 ` Denis Benato
2025-12-03 9:47 ` Ilpo Järvinen
2 siblings, 0 replies; 4+ messages in thread
From: Denis Benato @ 2025-11-29 13:54 UTC (permalink / raw)
To: Anton Khirnov, Corentin Chary, Luke D. Jones, Hans de Goede,
Ilpo Järvinen, Andy Shevchenko, Jian-Hong Pan
Cc: platform-driver-x86, linux-kernel
On 11/29/25 11:13, Anton Khirnov wrote:
> kbd_led_set() can sleep, and so may not be used as the brightness_set()
> callback.
>
> Otherwise using this led with a trigger leads to system hangs
> accompanied by:
> BUG: scheduling while atomic: acpi_fakekeyd/2588/0x00000003
> CPU: 4 UID: 0 PID: 2588 Comm: acpi_fakekeyd Not tainted 6.17.9+deb14-amd64 #1 PREEMPT(lazy) Debian 6.17.9-1
> Hardware name: ASUSTeK COMPUTER INC. ASUS EXPERTBOOK B9403CVAR/B9403CVAR, BIOS B9403CVAR.311 12/24/2024
> Call Trace:
> <TASK>
> [...]
> schedule_timeout+0xbd/0x100
> __down_common+0x175/0x290
> down_timeout+0x67/0x70
> acpi_os_wait_semaphore+0x57/0x90
> [...]
> asus_wmi_evaluate_method3+0x87/0x190 [asus_wmi]
> led_trigger_event+0x3f/0x60
> [...]
Hi and thank you very much for this!
Reviewed-by: Denis Benato <benato.denis96@gmail.com>
> Fixes: 9fe44fc98ce4 ("platform/x86: asus-wmi: Simplify the keyboard brightness updating process")
> Signed-off-by: Anton Khirnov <anton@khirnov.net>
> ---
> v2:
> - reworded commit message, adding traceback
> - merged lines in kbd_led_set() signature
> ---
> drivers/platform/x86/asus-wmi.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
> index e72a2b5d158e..8e3300f5c294 100644
> --- a/drivers/platform/x86/asus-wmi.c
> +++ b/drivers/platform/x86/asus-wmi.c
> @@ -1619,14 +1619,14 @@ static void do_kbd_led_set(struct led_classdev *led_cdev, int value)
> kbd_led_update(asus);
> }
>
> -static void kbd_led_set(struct led_classdev *led_cdev,
> - enum led_brightness value)
> +static int kbd_led_set(struct led_classdev *led_cdev, enum led_brightness value)
> {
> /* Prevent disabling keyboard backlight on module unregister */
> if (led_cdev->flags & LED_UNREGISTERING)
> - return;
> + return 0;
>
> do_kbd_led_set(led_cdev, value);
> + return 0;
> }
>
> static void kbd_led_set_by_kbd(struct asus_wmi *asus, enum led_brightness value)
> @@ -1802,7 +1802,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
> asus->kbd_led_wk = led_val;
> asus->kbd_led.name = "asus::kbd_backlight";
> asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
> - asus->kbd_led.brightness_set = kbd_led_set;
> + asus->kbd_led.brightness_set_blocking = kbd_led_set;
> asus->kbd_led.brightness_get = kbd_led_get;
> asus->kbd_led.max_brightness = 3;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led
2025-11-29 10:13 [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led Anton Khirnov
2025-11-29 13:32 ` Andy Shevchenko
2025-11-29 13:54 ` Denis Benato
@ 2025-12-03 9:47 ` Ilpo Järvinen
2 siblings, 0 replies; 4+ messages in thread
From: Ilpo Järvinen @ 2025-12-03 9:47 UTC (permalink / raw)
To: Corentin Chary, Luke D. Jones, Denis Benato, Hans de Goede,
Andy Shevchenko, Jian-Hong Pan, Anton Khirnov
Cc: platform-driver-x86, linux-kernel
On Sat, 29 Nov 2025 11:13:08 +0100, Anton Khirnov wrote:
> kbd_led_set() can sleep, and so may not be used as the brightness_set()
> callback.
>
> Otherwise using this led with a trigger leads to system hangs
> accompanied by:
> BUG: scheduling while atomic: acpi_fakekeyd/2588/0x00000003
> CPU: 4 UID: 0 PID: 2588 Comm: acpi_fakekeyd Not tainted 6.17.9+deb14-amd64 #1 PREEMPT(lazy) Debian 6.17.9-1
> Hardware name: ASUSTeK COMPUTER INC. ASUS EXPERTBOOK B9403CVAR/B9403CVAR, BIOS B9403CVAR.311 12/24/2024
> Call Trace:
> <TASK>
> [...]
> schedule_timeout+0xbd/0x100
> __down_common+0x175/0x290
> down_timeout+0x67/0x70
> acpi_os_wait_semaphore+0x57/0x90
> [...]
> asus_wmi_evaluate_method3+0x87/0x190 [asus_wmi]
> led_trigger_event+0x3f/0x60
> [...]
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led
commit: ccb61a328321ba3f8567e350664c9ca7a42b6c70
--
i.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-03 9:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-29 10:13 [PATCH v2] platform/x86: asus-wmi: use brightness_set_blocking() for kbd led Anton Khirnov
2025-11-29 13:32 ` Andy Shevchenko
2025-11-29 13:54 ` Denis Benato
2025-12-03 9:47 ` Ilpo Järvinen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.