From: Sean Young <sean@mess.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Ivaylo Dimitrov" <ivo.g.dimitrov.75@gmail.com>
Cc: linux-media@vger.kernel.org, "Tony Lindgren" <tony@atomide.com>,
"Russell King" <linux@armlinux.org.uk>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Timo Kokkonen" <timo.t.kokkonen@iki.fi>,
"Pali Rohár" <pali.rohar@gmail.com>,
"Sicelo A . Mhlongo" <absicsz@gmail.com>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-pwm@vger.kernel.org
Subject: Re: [PATCH v5 2/2] media: rc: remove ir-rx51 in favour of generic pwm-ir-tx
Date: Fri, 29 Sep 2023 17:20:09 +0100 [thread overview]
Message-ID: <ZRb5OWvx3GxYWf9g@gofer.mess.org> (raw)
In-Reply-To: <179c4674-aa5c-0573-6d1f-ea6f2694d156@gmail.com>
Hello Uwe,
Just wanted to run an idea by you.
On Fri, Sep 29, 2023 at 11:49:52AM +0300, Ivaylo Dimitrov wrote:
> On 26.09.23 г. 23:18 ч., Sean Young wrote:
> > I've never known of a solution to the pwm-ir-tx driver. If using hrtimers
> > directly improves the situation even a bit, then that would be great.
>
> The issue with hrtimers is that we cannot use them directly, as
> pwm_apply_state() may sleep, but hrtimer function is called in atomic
> context.
I've also been looking at this problem and came to same conclusion: the
fact that pwm_apply_state() sleeps is a huge problem.
1) The vast majority of pwm drivers don't sleep, or could even be converted
to spinlocks (e.g pwm-sifive.c could use spinlocks, as far as I can see).
2) Sure, some pwm devices are on i2c busses, so the driver needs to sleep.
Those devices aren't great for what we're trying to do here, since the
sleeping may cause delays and affect the generated signal.
What would be ideal here is to have pwm-ir-tx work in atomic context if
a non-sleeping pwm device is used, and another (non-optimal) code path
for sleeping pwm drivers. We could even just refuse to run on sleeping pwm
drivers.
Uwe what do you think of this idea? The pwm api could have a
bool pwm_may_sleep(struct pwm *pwm) function, and pwm_apply_state() does
not contain might_sleep() - only the driver-specific apply calls might_sleep().
It would be nice if this could all be done at compile time through e.g. a
device tree attribute.
Thanks,
Sean
next prev parent reply other threads:[~2023-09-29 16:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-01 14:18 [PATCH v5 0/2] Remove ir-rx51 driver Sean Young
2023-09-01 14:18 ` [PATCH v5 1/2] dt-bindings: media: remove nokia,n900-ir as pwm-ir-tx is compatible Sean Young
2023-09-02 10:50 ` Conor Dooley
2023-09-04 14:28 ` Lee Jones
2023-09-01 14:18 ` [PATCH v5 2/2] media: rc: remove ir-rx51 in favour of generic pwm-ir-tx Sean Young
2023-09-06 16:04 ` Uwe Kleine-König
2023-09-25 16:06 ` Ivaylo Dimitrov
2023-09-26 7:16 ` Sean Young
2023-09-26 7:37 ` Tony Lindgren
2023-09-26 12:54 ` Ivaylo Dimitrov
2023-09-26 12:43 ` Ivaylo Dimitrov
2023-09-26 20:18 ` Sean Young
2023-09-29 8:49 ` Ivaylo Dimitrov
2023-09-29 16:20 ` Sean Young [this message]
2023-09-29 21:08 ` Uwe Kleine-König
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=ZRb5OWvx3GxYWf9g@gofer.mess.org \
--to=sean@mess.org \
--cc=absicsz@gmail.com \
--cc=ivo.g.dimitrov.75@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mchehab@kernel.org \
--cc=pali.rohar@gmail.com \
--cc=thierry.reding@gmail.com \
--cc=timo.t.kokkonen@iki.fi \
--cc=tony@atomide.com \
--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).