linux-leds.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Eckert <fe@dev.tdt.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Pavel Machek <pavel@ucw.cz>, Lee Jones <lee@kernel.org>,
	linux-leds@vger.kernel.org,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>
Subject: Re: [PATCH] leds: trigger/tty: Use led_set_brightness_nosleep() to set brightness
Date: Mon, 17 Apr 2023 09:18:54 +0200	[thread overview]
Message-ID: <7b0c3ef0092ad6c19e592d4514e1c76f@dev.tdt.de> (raw)
In-Reply-To: <20230414164853.3668229-1-u.kleine-koenig@pengutronix.de>

Hello Uwe,

On 2023-04-14 18:48, Uwe Kleine-König wrote:
> After commit ba8a86e4dadb ("leds: trigger/tty: Use
> led_set_brightness_sync() from workqueue") this is the second try to
> pick the right function to set the LED brightness from a trigger.
> 
> led_set_brightness_sync() has the problem that it doesn't work for LEDs
> without a .brightness_set_blocking() callback. This is (among others)
> the case for LEDs connected to non-sleeping GPIOs.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> after a few (non-public and public) reports that the tty trigger 
> doesn't
> work and Jacek pointed out in
> https://lore.kernel.org/all/ad4a1069-72c6-a431-336f-ed78a57a1ba0@gmail.com/#t
> that led_set_brightness_nosleep() is the right function, here comes a
> patch to actually implement that.
> 
> Does this justify a Fixes line? In that case that would be:
> 
> 	Fixes: ba8a86e4dadb ("leds: trigger/tty: Use
> led_set_brightness_sync() from workqueue")
> 
> (As ba8a86e4dadb declares to be a fix for fd4a641ac88f ("leds: trigger:
> implement a tty trigger") I think a further reference to fd4a641ac88f
> isn't necesary.)
> 
> Best regards
> Uwe
> 
>  drivers/leds/trigger/ledtrig-tty.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/leds/trigger/ledtrig-tty.c
> b/drivers/leds/trigger/ledtrig-tty.c
> index f62db7e520b5..c8bbdeac93b9 100644
> --- a/drivers/leds/trigger/ledtrig-tty.c
> +++ b/drivers/leds/trigger/ledtrig-tty.c
> @@ -1,11 +1,11 @@
>  // SPDX-License-Identifier: GPL-2.0
> 
>  #include <linux/delay.h>
> -#include <linux/leds.h>
>  #include <linux/module.h>
>  #include <linux/slab.h>
>  #include <linux/tty.h>
>  #include <uapi/linux/serial.h>
> +#include "../leds.h"
> 
>  struct ledtrig_tty_data {
>  	struct led_classdev *led_cdev;
> @@ -122,12 +122,12 @@ static void ledtrig_tty_work(struct work_struct 
> *work)
> 
>  	if (icount.rx != trigger_data->rx ||
>  	    icount.tx != trigger_data->tx) {
> -		led_set_brightness_sync(trigger_data->led_cdev, LED_ON);
> +		led_set_brightness_nosleep(trigger_data->led_cdev, LED_ON);
> 
>  		trigger_data->rx = icount.rx;
>  		trigger_data->tx = icount.tx;
>  	} else {
> -		led_set_brightness_sync(trigger_data->led_cdev, LED_OFF);
> +		led_set_brightness_nosleep(trigger_data->led_cdev, LED_OFF);
>  	}
> 
>  out:
> 
> base-commit: fe15c26ee26efa11741a7b632e9f23b01aca4cc6

Tested-By: Florian Eckert <fe@dev.tdt.de>

  parent reply	other threads:[~2023-04-17  7:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-14 16:48 [PATCH] leds: trigger/tty: Use led_set_brightness_nosleep() to set brightness Uwe Kleine-König
2023-04-16 15:13 ` Jacek Anaszewski
2023-04-17  7:18 ` Florian Eckert [this message]
2023-04-17 12:28 ` Pavel Machek
2023-04-17 12:44   ` Uwe Kleine-König
2023-04-17 18:33     ` Jacek Anaszewski
2023-04-17 19:17       ` Uwe Kleine-König
2023-04-17 19:51         ` Jacek Anaszewski
2023-04-17 22:27           ` Uwe Kleine-König
2023-04-18 18:02             ` Jacek Anaszewski
2023-04-18 18:04               ` Jacek Anaszewski

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=7b0c3ef0092ad6c19e592d4514e1c76f@dev.tdt.de \
    --to=fe@dev.tdt.de \
    --cc=jacek.anaszewski@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=u.kleine-koenig@pengutronix.de \
    /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).