Re: [PATCH v3 5/6] pwm: fsl-ftm: Don't update the state for the caller of pwm_apply_state()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Sep 3, 2019 at 11:48 AM Uwe Kleine-König
<u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
>
> Hello,
>
> On Tue, Sep 03, 2019 at 09:54:37AM -0700, Doug Anderson wrote:
> > On Mon, Sep 2, 2019 at 7:27 AM Uwe Kleine-König
> > <u.kleine-koenig@xxxxxxxxxxxxxx> wrote:
> > > On Fri, Aug 30, 2019 at 10:39:16AM -0700, Doug Anderson wrote:
> > > > On Sat, Aug 24, 2019 at 8:37 AM Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx> wrote:
> > > > >
> > > > > The pwm-fsl-ftm driver is one of only three PWM drivers which updates
> > > > > the state for the caller of pwm_apply_state(). This might have
> > > > > surprising results if the caller reuses the values expecting them to
> > > > > still represent the same state.
> > > > >
> > > > > Signed-off-by: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
> > > > > ---
> > > > >  drivers/pwm/pwm-fsl-ftm.c | 4 ----
> > > > >  1 file changed, 4 deletions(-)
> > > >
> > > > Presumably this patch could break something since the pwm-fsl-ftm
> > > > driver doesn't appear to implement the get_state() function.  ...or
> > > > did I miss it?
> > >
> > > I don't expect breakage. We have more than 50 pwm drivers and only three
> > > of them made use of adapting the passed state. So unless you do
> > > something special with the PWM (i.e. more than backlight, LED or fan
> > > control) I don't think a consumer might care. But it might well be that
> > > I miss something so feel free to prove me wrong.
> >
> > I don't have this hardware so I can't prove you wrong.  ...but
> > presumably someone added the code to return the state on purpose?
> >
> > Maybe you could implement get_state() for this driver in your series?
>
> Sure, I could. But I don't have hardware either and so I'm not in a
> better position than anybody else on this list.
>
> I suggest to apply as is during the merge window, and let affected
> user report problems (or patches) if there really is an issue.
> Guessing what people might suffer from and trying to cure this with
> untested patches won't help I think.

I suppose it's not up to me, but I would rather have a patch that
attempts to keep things working like they did before rather than one
that is known to change behavior.  Even worse is that your patch
description doesn't mention this functionality change at all.

I will also note that not everyone does a deep test of all
functionality during every kernel merge window.  ...so your change in
functionality certain has a pretty high chance of remaining broken for
a while.  In addition if a PWM is used for something like a PWM
regulator then subtle changes can cause totally non-obvious breakages,
maybe adjusting regulators by a very small percentage.  If you
implement the getter it seems (to me) more likely you'll either get it
right or it will totally break things.  That's actually a much better
failure mode...


-Doug

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-rockchip




[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux