Re: [PATCH 11/13] dt-bindings: serial: restrict possible child node names

From: Rob Herring
Date: Wed Jan 25 2023 - 12:12:28 EST


On Tue, Jan 24, 2023 at 3:05 AM Krzysztof Kozlowski
<krzysztof.kozlowski@xxxxxxxxxx> wrote:
>
> On 24/01/2023 00:05, Rob Herring wrote:
> >
> > On Mon, 23 Jan 2023 16:13:00 +0100, Krzysztof Kozlowski wrote:
> >> The re-usable serial.yaml schema matches every property with ".*"
> >> pattern, thus any other schema referencing it will not report unknown
> >> (unevaluated) properties. This hides several wrong properties. It is
> >> a limitation of dtschema, thus provide a simple workaround: expect
> >> children to be only of few names matching upstream usage (Bluetooth,
> >> GNSS, GPS and MCU).
> >>
> >> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
> >> ---
> >> Documentation/devicetree/bindings/serial/serial.yaml | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >
> > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> > on your patch (DT_CHECKER_FLAGS is new in v5.13):
> >
> > yamllint warnings/errors:
> >
> > dtschema/dtc warnings/errors:
> > /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/bus/intel,ixp4xx-expansion-bus-controller.example.dtb: serial@1,0: Unevaluated properties are not allowed ('intel,ixp4xx-eb-byte-access', 'intel,ixp4xx-eb-cycle-type', 'intel,ixp4xx-eb-t3', 'intel,ixp4xx-eb-write-enable' were unexpected)
> > From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/serial/8250.yaml
>
> Eh, this is not trivial to solve. The
> "intel,ixp4xx-expansion-bus-controller.yaml" bindings add properties to
> children nodes, just like spi-peripheral-props:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/bus/intel,ixp4xx-expansion-bus-controller.yaml?h=v6.2-rc5#n147

Yep, those properties probably need to go into mc-peripheral-props.yaml.

> Any node can be there:
> 1. serial, which was broken since beginning but errors not visible,

8250 only in all likelyhood.

> 2. flash, which work fine just because mtd-physmap.yaml allows it,
> 3. more?

I guess it is *only* external parallel bus devices...

>
> Existing DTS of this ixp4xx controller have different nodes, for example:
> flash, shared-dma-pool, ns8250, arcom,vulcan-gpio, maxim,max6369:

'shared-dma-pool' is odd.

So is max6369. Looks like that h/w was creatively attached.

> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/intel-ixp42x-arcom-vulcan.dts?h=v6.2-rc5#n40
>
> Probably we need expansion-bus-controller-peripheral-props.yaml and
> include it in every possible child. Does it sound reasonable?

What's the difference to mc-peripheral-props.yaml?

Honestly, this stuff is somewhat rare that I'd rather worry about it
later. Maybe ixp4xx will be removed by then... We could just comment
out the problematic parts of the example for now.

Rob