Skip to content

Commit

Permalink
Merge tag 'led-fixes-for-5.2-rc3' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/j.anaszewski/linux-leds

Pull LED fix from Jacek Anaszewski:
 "Fix for a recent change in LED core, that didn't take into account the
  possibility of calling led_blink_setup() from atomic context"

* tag 'led-fixes-for-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds:
  leds: avoid flush_work in atomic context
  • Loading branch information
Linus Torvalds committed Jun 2, 2019
2 parents 9221dce + 8c0f693 commit f58c356
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 0 additions & 5 deletions drivers/leds/led-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ static void led_blink_setup(struct led_classdev *led_cdev,
unsigned long *delay_on,
unsigned long *delay_off)
{
/*
* 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);
if (!test_bit(LED_BLINK_ONESHOT, &led_cdev->work_flags) &&
led_cdev->blink_set &&
!led_cdev->blink_set(led_cdev, delay_on, delay_off))
Expand Down
5 changes: 5 additions & 0 deletions drivers/leds/trigger/ledtrig-timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,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);

Expand Down

0 comments on commit f58c356

Please sign in to comment.