RE: [PATCH] iio: ad5770r: make devicetree property reading consistent

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

 




> -----Original Message-----
> From: Jonathan Cameron <jic23@xxxxxxxxxx>
> Sent: Saturday, August 14, 2021 6:04 PM
> To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> Cc: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>; Rob Herring
> <robh+dt@xxxxxxxxxx>; linux-iio <linux-iio@xxxxxxxxxxxxxxx>;
> Hennerich, Michael <Michael.Hennerich@xxxxxxxxxx>; Lars-Peter
> Clausen <lars@xxxxxxxxxx>
> Subject: Re: [PATCH] iio: ad5770r: make devicetree property reading
> consistent
> 
> [External]
> 
> On Fri, 13 Aug 2021 10:05:17 +0000
> "Sa, Nuno" <Nuno.Sa@xxxxxxxxxx> wrote:
> 
> > > -----Original Message-----
> > > From: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> > > Sent: Friday, August 13, 2021 10:05 AM
> > > To: Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> > > Cc: Rob Herring <robh+dt@xxxxxxxxxx>; linux-iio <linux-
> > > iio@xxxxxxxxxxxxxxx>; Jonathan Cameron <jic23@xxxxxxxxxx>;
> > > Hennerich, Michael <Michael.Hennerich@xxxxxxxxxx>; Lars-Peter
> > > Clausen <lars@xxxxxxxxxx>
> > > Subject: Re: [PATCH] iio: ad5770r: make devicetree property
> reading
> > > consistent
> > >
> > > On Fri, Aug 13, 2021 at 10:47 AM Sa, Nuno <Nuno.Sa@xxxxxxxxxx>
> > > wrote:
> > > > > From: Rob Herring <robh+dt@xxxxxxxxxx>
> > > > > Sent: Thursday, August 12, 2021 5:11 PM
> > > > > On Thu, Aug 12, 2021 at 3:14 AM Sa, Nuno
> <Nuno.Sa@xxxxxxxxxx>
> > > > > wrote:
> > >
> > > ...
> > >
> > > > > > Could you give your input on this one?
> > > > >
> > > > > There's no context, but I'm assuming this is in channel nodes.
> Keep
> > > >
> > > > Sorry about that. Your assumption is correct, the binding is for a
> > > channel
> > > > node [1]. The driver just get's it as 'num' [2] which is not
> consistent.
> > > > Naively, I just though changing the driver to use reg would be
> > > enough
> > > > but Andy nicely raised the question of someone being already
> relying
> > > > on 'num'...
> > > >
> > > > > the binding 'reg' and make the driver support both if needed.
> > > > > Considering the author of the binding also changed the binding
> > > from
> > > > > num to reg shortly after adding the binding, I don't think 'num'
> > > > > support is needed. If someone used 'num' and didn't run
> > > validation,
> > > > > well, that's their problem.
> > > > >
> > > >
> > > > So I guess the solution here is just to change the driver to support
> > > both
> > > > reg and num.
> > >
> > > As far as I got Rob's answer, if the binding never had the 'num',
> > > dropping it from the driver is what we want now (actually your
> > > original patch) and users, who are 'too much clever' :-) should have
> > > had run validation for their DTs before production.
> > >
> > > Taking this into account, I'm fine with the patch (but update a
> commit
> > > message to summarize this discussion)
> > > Reviewed-by: Andy Shevchenko <andy.shevchenko@xxxxxxxxx>
> > >
> >
> > You're right...
> > Jonathan, do you want a v2 with an updated commit message?
> 
> Please do. Also please add a fixes tag given we are treating it
> as a fix.  If we discover someone is using the num variant then
> we'll just have to support both values as a fix to the fix.
> Not ideal, but as observed, hopefully people are validating the
> DTs (which basically means no one is using this in production or
> it would have been pointed out before).
> 

Well, It seems we need to go through the support both 'num' and 'reg'
route... I did some git blaming and it turns out 'num' was actually supported
in the bindings [1]. After some time it was replaced by 'reg' [2] leaving the
driver unchanged... I guess we have a significant window of time here
where someone could deploy a *validated* devicetree using 'num'...
If no objections, on v2 I will just try to get 'reg' and if not present, fallback
to 'num' before erroring out.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ea52c21268e68cfdc1aabe686b154d73d8bf4d7e
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2cf3818f18b26992ff20a730df46e08e2485fd67

- Nuno Sá




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux