Re: [PATCH] [RFC] of: Add debug aid to find unused device tree properties
From: Rob Herring
Date: Mon Oct 14 2024 - 10:42:09 EST
On Mon, Oct 14, 2024 at 3:51 AM Richard Weinberger
<richard@xxxxxxxxxxxxx> wrote:
>
> Krzysztof,
>
> Am Montag, 14. Oktober 2024, 09:49:14 CEST schrieb 'Krzysztof Kozlowski' via upstream:
> > On Sun, Oct 13, 2024 at 10:07:30PM +0200, Richard Weinberger wrote:
> > > This is a proof-of-concept patch that introduces a debug feature I find
> > > particularly useful. I frequently encounter situations where I'm
> > > uncertain if my device tree configuration is correct or being utilized
> > > by the kernel. This is especially common when porting device trees
> > > from vendor kernels, as some properties may have slightly different
> > > names in the upstream kernel, or upstream drivers may not use certain
> > > properties at all.
> >
> > In general I don't mind, but I have a comment about above rationale.
> > It's just wrong. The point of DT is to describe hardware, not the one
> > given, fixed in time implementation.
>
> I agree with you, sorry for being imprecise.
>
> > What's more, writing bindings mentions this explicit: make binding
> > complete, even if it is not used.
>
> Yes, with this aid, it is IMHO easier to find bindings that need attention.
> Just as an example, lately the device tree of a vendor used the property "timers",
> but in mainline it is "ti,timers". With this debug feature, it is easy to see that
> "timers" is not being used, and somebody has to decide whether the property is
> really not used by a driver, or if the binding needs more work.
Paying attention to the schema warnings would have found this issue.
Assuming there is a schema for the node...
That's not to say this type of run-time check is not also useful.
Rob