linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eddie James <eajames@linux.ibm.com>
To: pavel@ucw.cz
Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] leds: Ensure hardware blinking turns off when requested
Date: Wed, 5 Apr 2023 11:25:59 -0500	[thread overview]
Message-ID: <bc6564dc-3bfd-298b-43a8-b5a629f4631f@linux.ibm.com> (raw)
In-Reply-To: <20220520171134.31415-1-eajames@linux.ibm.com>


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.


I just realized this never made it anywhere. Pavel, any thoughts?


Thanks,

Eddie


>
> Fixes: 4d71a4a12b13 ("leds: Add support for setting brightness in a synchronous way")
> Signed-off-by: Eddie James <eajames@linux.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);
>   

  parent reply	other threads:[~2023-04-05 16:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20 17:11 [PATCH] leds: Ensure hardware blinking turns off when requested Eddie James
2022-09-06 20:47 ` Eddie James
2023-04-05 16:25 ` Eddie James [this message]
2023-04-05 16:44   ` Lee Jones
  -- strict thread matches above, loose matches on Subject: below --
2025-01-30 19:46 Eddie James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bc6564dc-3bfd-298b-43a8-b5a629f4631f@linux.ibm.com \
    --to=eajames@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).