OpenCloudOS-Kernel/drivers/leds/trigger
Thomas Weißschuh 93ac74cd6f 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-11 12:47:14 +02:00
..
Kconfig leds: Mark GPIO LED trigger broken 2023-03-16 15:08:44 +00:00
Makefile leds: trigger: implement a tty trigger 2021-01-15 10:22:26 +01:00
ledtrig-activity.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08: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 treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ledtrig-camera.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ledtrig-cpu.c leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' 2023-11-20 11:59:24 +01:00
ledtrig-default-on.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ledtrig-disk.c leds: Change led_trigger_blink[_oneshot]() delay parameters to pass-by-value 2023-05-25 12:16:27 +01:00
ledtrig-gpio.c leds: trigger: gpio: Avoid warning on update of inverted 2020-07-12 10:06:38 +02:00
ledtrig-heartbeat.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
ledtrig-mtd.c leds: Change led_trigger_blink[_oneshot]() delay parameters to pass-by-value 2023-05-25 12:16:27 +01:00
ledtrig-netdev.c leds: trigger: netdev: Fix kernel panic on interface rename trig notify 2024-04-03 15:28:27 +02:00
ledtrig-oneshot.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ledtrig-panic.c leds: trigger: panic: Don't register panic notifier if creating the trigger failed 2024-02-05 20:14:30 +00:00
ledtrig-pattern.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
ledtrig-timer.c leds: triggers: Flush pending brightness before activating trigger 2024-08-11 12:47:14 +02:00
ledtrig-transient.c treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
ledtrig-tty.c leds: ledtrig-tty: Free allocated ttyname buffer on deactivate 2024-01-20 11:51:48 +01:00