Re: [PATCH 09/15] dt-bindings: phy: qcom,qmp-pcie: mark current bindings as legacy

Johan Hovold
2022-10-19T11:06:16Z

On Tue, Oct 18, 2022 at 12:44:22PM -0400, Krzysztof Kozlowski wrote:
> On 18/10/2022 12:04, Johan Hovold wrote:

> > The question is whether to convert also the current bindings and DTS to
> > the new (sc8280xp) scheme (e.g. drop the child nodes and register
> > subregions).
> >
> > The driver can support both binding schemes using the same compatible
> > strings for a transition period (or in theory forever) by checking for
> > the existence of a child node.
> >
> > Converting the DTS to use the new bindings would obviously prevent using
> > them with an old kernel (i.e. 2 above), but I don't think that's a
> > problem (unlike backward compatibility during at least a transition
> > period).
>
> It is still not nice towards any other users of DTS, because this will
> break all of them. I agree this won't be ABI type of break. It is
> discouraged though, unless there are clear benefits from this or one
> totally does not care about other DTS users...
>
> As I said it is up to platform maintainer.

Yeah. When time I spoke to Bjorn about this, we agreed to draw the line
at SC8280XP.

But if it turns out converting older platforms is needed to fix bugs or
add features (e.g. due to the incomplete register descriptions), we may
later have to reconsider this.

> > My concern was how to describe the deprecation in DT schema if we were
> > convert them. By instead just keeping the old bindings as-is in a
> > separate file and continuing to support them in the driver we can have a
> > nice and clean description of the new bindings (sc8280xp) without the
> > legacy cruft.
>
> You cannot have one compatible in two schemas, so for old bindings (and
> DTS):
> 1. Don't convert them,
> 2. Convert with keeping old properties - as you pointed this might be
> full of conditionals/allOf, so difficult to maintain and read,
> 3. Convert dropping old stuff.
>
> For the option 3. for sure Rob will ask why. :)

Thanks for confirming.

So I guess we start with keeping the old bindings as they are (1) and if
later needed (or desired) we should simply drop the old bindings (3)
from the schema (we can still have the driver support the old bindings
during a transition period).

> > If we were to start introducing conditionals on existence of child
> > nodes, and marking the old bindings as deprecated in one large schema,
> > then that sounds like it would be very messy and hard to read and
> > maintain. But perhaps there is some way to do this without such
> > downsides that I'm not aware of.

Johan