[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f0f3a8c5-113c-7070-4613-150cc0cd20a6@linux.ibm.com>
Date: Tue, 6 Sep 2022 15:47:40 -0500
From: Eddie James <eajames@...ux.ibm.com>
To: pavel@....cz
Cc: linux-leds@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] leds: Ensure hardware blinking turns off when requested
Any update on this?
Thanks,
Eddie
On 5/20/22 12:11, Eddie James wrote:
> If an LED is blinking through the hardware and the trigger is deactivated,
> the driver will set the brightness to 0 to disable blinking. However, if
> the LED driver doesn't support non-blocking operations, the request for
> setting brightness to 0 will get queued. Then if a user requests a new
> non-zero brightness before the request for 0 brightness is executed, the
> LED blinking will not get disabled since the brightness will simply be
> updated.
> Fix this by flushing the workqueue before updating the requested
> brightness.
>
> Fixes: 4d71a4a12b13 ("leds: Add support for setting brightness in a synchronous way")
> Signed-off-by: Eddie James <eajames@...ux.ibm.com>
> ---
> drivers/leds/led-class.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c
> index 6a8ea94834fa..861a1cb5df5b 100644
> --- a/drivers/leds/led-class.c
> +++ b/drivers/leds/led-class.c
> @@ -55,6 +55,8 @@ static ssize_t brightness_store(struct device *dev,
>
> if (state == LED_OFF)
> led_trigger_remove(led_cdev);
> + /* flush out any request to disable blinking */
> + flush_work(&led_cdev->set_brightness_work);
> led_set_brightness(led_cdev, state);
> flush_work(&led_cdev->set_brightness_work);
>
Powered by blists - more mailing lists