From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Pavel Machek <pavel@ucw.cz>
Cc: Lee Jones <lee@kernel.org>,
linux-leds@vger.kernel.org,
Jacek Anaszewski <jacek.anaszewski@gmail.com>,
Florian Eckert <fe@dev.tdt.de>
Subject: Re: [PATCH] leds: trigger/tty: Use led_set_brightness_nosleep() to set brightness
Date: Mon, 17 Apr 2023 14:44:03 +0200 [thread overview]
Message-ID: <20230417124403.j64c2lftgyqo2a67@pengutronix.de> (raw)
In-Reply-To: <ZD07hLV1gs+gw26s@duo.ucw.cz>
[-- Attachment #1: Type: text/plain, Size: 1278 bytes --]
Hello,
On Mon, Apr 17, 2023 at 02:28:52PM +0200, Pavel Machek 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>
>
> I don't think this is right.
>
> _nosleep calls _nopm, which assmues it can't sleep, and schedules
> another workqueue to set the LED.
Then which is the right variant?
led_set_brightness() and led_set_brightness_nosleep() set via a workqueue
(which is bad) and led_set_brightness_sync() doesn't work for some LEDs
(notably LEDs on non-sleeping GPIOs).
From reading the code comments led_set_brightness_sync() sounds like the
right function to call, so maybe we only need to fix gpio-led (and maybe
some others)?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2023-04-17 12:44 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
2023-04-17 12:28 ` Pavel Machek
2023-04-17 12:44 ` Uwe Kleine-König [this message]
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=20230417124403.j64c2lftgyqo2a67@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=fe@dev.tdt.de \
--cc=jacek.anaszewski@gmail.com \
--cc=lee@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).