WSL2-Linux-Kernel/drivers/leds/trigger
Thomas Weißschuh 780785c77e leds: triggers: Flush pending brightness before activating trigger
[ Upstream commit ab477b766edd3bfb6321a6e3df4c790612613fae ]

The race fixed in timer_trig_activate() between a blocking
set_brightness() call and trigger->activate() can affect any trigger.
So move the call to flush_work() into led_trigger_set() where it can
avoid the race for all triggers.

Fixes: 0db37915d9 ("leds: avoid races with workqueue")
Fixes: 8c0f693c6e ("leds: avoid flush_work in atomic context")
Cc: stable@vger.kernel.org
Tested-by: Dustin L. Howett <dustin@howett.net>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20240613-led-trigger-flush-v2-1-f4f970799d77@weissschuh.net
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-19 05:45:29 +02:00
..
Kconfig leds: trigger: remove reference to obsolete CONFIG_IDE_GD_ATA 2021-08-18 08:59:47 +02:00
Makefile leds: trigger: implement a tty trigger 2021-01-15 10:22:26 +01:00
ledtrig-activity.c kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
ledtrig-audio.c leds: trigger: audio: Add an activate callback to ensure the initial brightness is set 2021-08-03 23:57:17 +02:00
ledtrig-backlight.c
ledtrig-camera.c
ledtrig-cpu.c leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' 2023-11-20 11:08:25 +01:00
ledtrig-default-on.c
ledtrig-disk.c
ledtrig-gpio.c leds: trigger: gpio: Avoid warning on update of inverted 2020-07-12 10:06:38 +02:00
ledtrig-heartbeat.c kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
ledtrig-mtd.c
ledtrig-netdev.c leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename 2023-07-23 13:47:36 +02:00
ledtrig-oneshot.c
ledtrig-panic.c leds: trigger: panic: Don't register panic notifier if creating the trigger failed 2024-02-23 08:54:49 +01:00
ledtrig-pattern.c leds: trigger: pattern: Switch to using the new API kobj_to_dev() 2021-04-25 23:38:10 +02:00
ledtrig-timer.c leds: triggers: Flush pending brightness before activating trigger 2024-08-19 05:45:29 +02:00
ledtrig-transient.c
ledtrig-tty.c leds: ledtrig-tty: Free allocated ttyname buffer on deactivate 2024-01-25 14:52:32 -08:00