Revert "leds: triggers: Flush pending brightness before activating trigger"

This reverts commit 93ac74cd6f which is
commit ab477b766e upstream.

It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.

Bug: 161946584
Change-Id: Iac75019b57af7941f928d7c048379f5b841f8973
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2024-08-16 14:25:03 +00:00
parent 93aa9d1549
commit e7c29758db
2 changed files with 5 additions and 6 deletions

View File

@ -201,12 +201,6 @@ int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig)
*/
synchronize_rcu();
/*
* If "set brightness to 0" is pending in workqueue,
* we don't want that to be reordered after ->activate()
*/
flush_work(&led_cdev->set_brightness_work);
ret = 0;
if (trig->activate)
ret = trig->activate(led_cdev);

View File

@ -110,6 +110,11 @@ static int timer_trig_activate(struct led_classdev *led_cdev)
led_cdev->flags &= ~LED_INIT_DEFAULT_TRIGGER;
}
/*
* If "set brightness to 0" is pending in workqueue, we don't
* want that to be reordered after blink_set()
*/
flush_work(&led_cdev->set_brightness_work);
led_blink_set(led_cdev, &led_cdev->blink_delay_on,
&led_cdev->blink_delay_off);