Re: [GIT PULL] pwm: Changes for v5.5-rc1

From: Uwe Kleine-König
Date: Thu Dec 05 2019 - 07:09:49 EST


Hello Thierry,

On Thu, Dec 05, 2019 at 12:04:25PM +0100, Thierry Reding wrote:
> On Thu, Dec 05, 2019 at 11:05:35AM +0100, Uwe Kleine-König wrote:
> > On Thu, Dec 05, 2019 at 09:41:02AM +0100, Thierry Reding wrote:
> > > Review for this came in after v5.4-rc7, so I didn't consider it for
> > > v5.5. I'll pick it up after v5.5-rc1.
> >
> > I got Steven's mail on Oct 24 which is the week between -rc4 and -rc5,
> > but ok, I won't argue.
>
> Both my inbox and patchwork say that the email arrived on November 13.

Ah, you're right. Oct 24 was the date I sent the patch. Don't know what
I saw before. Please forgive my wrong correction.

> > > > - The series starting with "pwm: omap-dmtimer: remove pwmchip in
> > > > .remove before making it unfunctional" from November which IMHO is
> > > > simple and contains two fixes
> > > > (https://patchwork.ozlabs.org/project/linux-pwm/list/?series=142030)
> > >
> > > Same here.
> >
> > Does "after v5.5-rc1" mean "for v5.5" or "for v5.6-rc1". I agree that
> > the tracing stuff is merge window material (very useful though in my
> > eyes) while the omap-dmtimer series (at least the first 3 of 4 patches)
> > is about fixes.
>
> These all change code that's been like this for more than 4 years and
> nobody's ever reported a bug.

That nobody uncovered a certain bug before should not stop us fixing it
quickly.

> The very worst that can happen here is that we leak a device
> reference, but these are platform devices, so they aren't going to go
> anywhere anyway.

Unless someone unloads the driver or unbinds it from the device. Even if
you question that this warrants an urgent fix (which I disagree to),
then patch 2 fixes an error path and patch 3 an unconditional resouce
leak (both in .probe).

> > > > And I'm still waiting for feedback on
> > > >
> > > > - "Documentation: pwm: rework documentation for the framework" (since
> > > > January)
> > >
> > > Please resend this, I can't find it in my inbox.
> >
> > :-|, given that I sent this already twice, pinged several times
> > (https://patchwork.ozlabs.org/patch/1021566/,
> > https://patchwork.ozlabs.org/patch/1000709/) and also asked at least
> > once before in a mail where I pinged several patches using a list.
>
> I find patchwork always difficult for reviewing, but that patch is
> particularly difficult to review. You're basically rewriting all of the
> documentation in a way that you think is better. It'd be much easier to
> review if this was done more incrementally.
>
> It looks like your goals could be easily met by just extending the
> existing documentation, or bringing it up-to-date with the API.

OK, will try to split it in smaller chunks.

> > > > - "pwm: add debug knob to help driver authors" (since August)
> > >
> > > My recollection is that this flagged a bunch of issues right out of the
> > > box, so I'm hesitant to apply it without wider concensus that we want
> > > this, or some effort to address the issues that this flags.
> >
> > I didn't want you to apply it. That it is not ready for that is out of
> > the question. I assume the patch doesn't apply anymore and needs work
> > for sure. The last mail in the respective thread had a single paragraph:
> >
> > do you consider the idea here worthwile? If so I'd update the
> > patch to current mainline and address the feedback I got so far.
> >
> > This is still interesting, as I don't want to spend my time working on
> > an idea that is then turned down in the end for conceptual reasons.
>
> There's nothing conceptually wrong about it. The one problem that I see
> with it is that we can't force people to use it because it's noisy when
> things go wrong, and they currently do go wrong. On the other hand, if
> we don't enforce its use, developers are likely to just ignore its
> existence.

I agree that it doesn't help when a driver author has this disabled. But
still it helps to catch problems if testers know it or during review
something is catched and then you only need to point to this Kconfig
setting instead of referencing the documentation or otherwise explain
what you want.
And even if there is only a 0.2 chance that a prospective pwm driver
author will enable it and so have a better driver in patch submission
round 1 it's already worth the effort in my eyes.

All in all I think "but some might not profit unless you force them"
isn't a reason good enough to not do something for those who might
notice and benefit from your work. And even if it's only me who benefits
that's good enough, too (assuming there are no downsides for others).

> So I think we need to get drivers into a little better shape so that we

For getting there having this knob configurable (and default off) is
already helpful.

> eliminate at least all of the issues that currently exist. Then we can
> merge this and maybe opportunistically enforce this during a release
> cycle to see if there's any fallout.

And if there is fallout just having to change some Kconfig magic to
disable the checks would be good. So having PWM_DEBUG seems like a good
idea to me.

Not sure that defaulting to all these checks is a good idea as at least
some of them introduce some delays waiting for completed periods. Having
this configurable seems to work for other subsystems just fine (judging
from looking at the output of

git grep DEBUG drivers/*/Kconfig

).

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |