Re: [PATCH] leds: triggers: flush pending brightness before activating trigger

From: Lee Jones
Date: Thu Jun 13 2024 - 11:03:01 EST


On Mon, 03 Jun 2024, Thomas Weißschuh wrote:

> 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: 0db37915d912 ("leds: avoid races with workqueue")
> Fixes: 8c0f693c6eff ("leds: avoid flush_work in atomic context")
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
> ---
> Dustin, could you validate that this fixes the issue you encountered in
> the cros_ec led driver?
> ---
> drivers/leds/led-triggers.c | 10 ++++++++--
> drivers/leds/trigger/ledtrig-timer.c | 5 -----
> 2 files changed, 8 insertions(+), 7 deletions(-)

This patch clashes with:

https://lore.kernel.org/all/20240531120124.75662-1-hdegoede@xxxxxxxxxx/

Please rebase and ensure that your solution doesn't conflict.

--
Lee Jones [李琼斯]