Commit 32360bf6 authored by Dmitry Rokosov's avatar Dmitry Rokosov Committed by Lee Jones
Browse files

leds: Introduce ordered workqueue for LEDs events instead of system_wq



This allows to setup ordered workqueue for LEDs events. This may be
useful, because default 'system_wq' does not guarantee execution order
of each work_struct, thus for several brightness update requests (for
multiple LEDs), real brightness switch could be in random order.

Yes, for sysfs-based LEDs we have flush_work() call inside
brightness_store() operation, but it's blocking call, so userspace
caller can be blocked at a long time, which means LEDs animation stream
can be broken.

Ordered workqueue has the same behaviour as system_wq + flush_work(),
but all scheduled works are async and userspace caller is not blocked,
which it better for userspace animation scheduling.

Signed-off-by: default avatarAlexey Romanov <avromanov@salutedevices.com>
Signed-off-by: default avatarDmitry Rokosov <ddrokosov@salutedevices.com>
Link: https://lore.kernel.org/r/20240903223936.21292-1-ddrokosov@salutedevices.com


[Lee: Couple of style fix-ups]
Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent 64dd44a6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment