From: Thierry Reding <thierry.reding@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Enric Balletbo i Serra <enric.balletbo@collabora.com>,
linux-pwm@vger.kernel.org
Subject: Re: [PATCH 1/4] pwm: Read initial hardware state at request time
Date: Mon, 21 Oct 2019 16:27:01 +0200 [thread overview]
Message-ID: <20191021142701.GB1476994@ulmo> (raw)
In-Reply-To: <20191021111112.n24kme2va6net7g3@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 2128 bytes --]
On Mon, Oct 21, 2019 at 01:11:12PM +0200, Uwe Kleine-König wrote:
> Hello Thierry,
>
> On Mon, Oct 21, 2019 at 12:57:36PM +0200, Thierry Reding wrote:
> > The PWM core doesn't need to know about the hardware state of a PWM
> > unless there is a user for it. Defer initial hardware readout until
> > a PWM is requested.
>
> A side effect is that for an unused PWM the get_state callback is never
> called (which is good), in return it is called more than once if the PWM
> is requested more often (which is bearable).
You can't request a PWM more than once. PWMs are always exclusive to a
single driver. Now I suppose you could have a single driver request it
multiple times (that driver would then also have to release it before
requesting it again), but I think it's reasonable for the subsystem to
query the hardware state everytime before a PWM is handed to a consumer.
The hardware state could have changed between the time where a consumer
releases the PWM and another requests it.
>
> > As a side-effect, this allows the ->get_state() callback to rely on
> > per-PWM data.
>
> Given that this is the motivation for your change I'd give more stress
> to this part of the commit log. Also I think this could be more
> understandable if you point out that the effect is that .get_state is
> only called after .request was called successfully which gives the low
> level driver more freedom by (for example) relying on memory allocated
> there.
Isn't that pretty much already in the above commit message just with
different words? I can try to reword this in a different way if that
makes you happier.
> I assume you target the next merge window for this change?
Yes. I'm not sure yet about the remainder of the series. Depending on
what we decide to do about drivers that can't (or don't want to) write
all state through to the hardware, patches 2-4 may become moot.
Thierry
>
> Best regards
> Uwe
>
> --
> Pengutronix e.K. | Uwe Kleine-König |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-10-21 14:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-21 10:57 [PATCH 1/4] pwm: Read initial hardware state at request time Thierry Reding
2019-10-21 10:57 ` [PATCH 2/4] pwm: cros-ec: Cache duty cycle value Thierry Reding
2019-10-21 13:48 ` Enric Balletbo i Serra
2019-12-05 7:12 ` Uwe Kleine-König
2019-10-21 10:57 ` [PATCH 3/4] pwm: imx27: Cache duty cycle register value Thierry Reding
2019-10-21 13:46 ` Michal Vokáč
2019-10-21 14:21 ` Adam Ford
2019-10-21 10:57 ` [PATCH 4/4] pwm: imx27: Unconditionally write state to hardware Thierry Reding
2019-10-21 13:49 ` Michal Vokáč
2019-10-21 14:21 ` Adam Ford
2019-10-21 11:11 ` [PATCH 1/4] pwm: Read initial hardware state at request time Uwe Kleine-König
2019-10-21 14:27 ` Thierry Reding [this message]
2019-10-21 13:34 ` Michal Vokáč
2019-10-21 13:46 ` Enric Balletbo i Serra
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=20191021142701.GB1476994@ulmo \
--to=thierry.reding@gmail.com \
--cc=enric.balletbo@collabora.com \
--cc=linux-pwm@vger.kernel.org \
--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