Re: [PATCH 1/3] media: dt: bindings: sunxi-ir: Add A64 compatible
From: Chen-Yu Tsai
Date: Thu Jan 24 2019 - 21:29:26 EST
On Tue, Jan 22, 2019 at 9:38 PM Rob Herring <robh@xxxxxxxxxx> wrote:
>
> On Mon, Jan 21, 2019 at 8:16 PM Chen-Yu Tsai <wens@xxxxxxxx> wrote:
> >
> > On Tue, Jan 22, 2019 at 8:19 AM Rob Herring <robh@xxxxxxxxxx> wrote:
> > >
> > > On Mon, Jan 21, 2019 at 05:57:57PM +0800, Chen-Yu Tsai wrote:
> > > > On Mon, Jan 21, 2019 at 5:50 PM Maxime Ripard <maxime.ripard@xxxxxxxxxxx> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > I'm a bit late to the party, sorry for that.
> > > > >
> > > > > On Sat, Jan 12, 2019 at 09:56:11AM +0800, Chen-Yu Tsai wrote:
> > > > > > On Sat, Jan 12, 2019 at 1:30 AM Jernej Skrabec <jernej.skrabec@xxxxxxxx> wrote:
> > > > > > >
> > > > > > > A64 IR is compatible with A13, so add A64 compatible with A13 as a
> > > > > > > fallback.
> > > > > >
> > > > > > We ask people to add the SoC-specific compatible as a contigency,
> > > > > > in case things turn out to be not so "compatible".
> > > > > >
> > > > > > To be consistent with all the other SoCs and other peripherals,
> > > > > > unless you already spotted a "compatible" difference in the
> > > > > > hardware, i.e. the hardware isn't completely the same, this
> > > > > > patch isn't needed. On the other hand, if you did, please mention
> > > > > > the differences in the commit log.
> > > > >
> > > > > Even if we don't spot things, since we have the stable DT now, if we
> > > > > ever had that compatible in the DT from day 1, it's much easier to
> > > > > deal with.
> > > > >
> > > > > I'd really like to have that pattern for all the IPs even if we didn't
> > > > > spot any issue, since we can't really say that the datasheet are
> > > > > complete, and one can always make a mistake and overlook something.
> > > > >
> > > > > I'm fine with this version, and can apply it as is if we all agree.
> > > >
> > > > I'm OK with having the fallback compatible. I'm just pointing out
> > > > that there are and will be a whole bunch of them, and we don't need
> > > > to document all of them unless we are actually doing something to
> > > > support them.
> > >
> > > Yes, you do. Otherwise, how will we validate what is and isn't a valid
> > > set of compatible strings? It's not required yet, but bindings are
> > > moving to json-schema.
> >
> > Ideally, if we knew which IP blocks in each SoC were compatible with
> > each other, we wouldn't need "per-SoC" compatible strings for each
> > block. However in reality this doesn't happen, due to a combination
> > of lack of time, lack of / uncertainty of documentation, and lack of
> > hardware for testing by the contributors.
> >
> > The per-SoC compatible we ask people to add are a contigency plan,
> > for when things don't actually work, and we need some way to support
> > that specific piece of hardware on old DTs.
>
> You are right up to here.
>
> > At which point we will
> > add that SoC-specific compatible as a new compatible string to the
> > bindings. But not before.
>
> No, the point SoC-specific compatibles is they are already present in
> the DT and you only have to update the OS to fix issues. The SoC
> specific compatible has to be documented when first used in dts files,
> not when the OS uses them. That is the rule.
We also want to be able to differentiate between per-SoC compatibles
vs actual backwards-compatible tuples, such as
- "allwinner,sun8i-r40-rtc", "allwinner,sun8i-h3-rtc"
found in Documentation/devicetree/bindings/rtc/sun6i-rtc.txt .
In the future, if someone has the time to do an in-depth comparison
and testing, they should be able to deprecated and/or remove the per-SoC
compatible strings that we added for contingency from the bindings.
As such, I'd like implementors to not target the SoC-specific compatibles,
unless imcompatiblities are discovered, at which point the bindings would
also be updated, removing the fallback compatible.
The SoC-specific compatible strings are really a workaround for the lack
of resources of the community supporting this platform, while being able
to support DT stability. I want to make it clear in some way visible to
all that this is an exception, not the norm. And I'd also like to leave
the door open to later cleanup.
What would be an acceptable way to do this? Add extra notes accompanying
the per-SoC compatibles?
Regards
ChenYu