[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEXTbpdkP2KM=ByCGP-S7ZMZFjFOaQynPzf7j139aQ4zU=jzrQ@mail.gmail.com>
Date: Wed, 30 Apr 2025 21:17:24 +0800
From: Pin-yen Lin <treapking@...omium.org>
To: Stephen Boyd <swboyd@...omium.org>
Cc: Conor Dooley <conor+dt@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Matthias Kaehlcke <mka@...omium.org>, Rob Herring <robh@...nel.org>,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-usb@...r.kernel.org
Subject: Re: [PATCH v3 3/4] dt-bindings: usb: realtek,rts5411: Adapt usb-hub.yaml
On Wed, Apr 30, 2025 at 2:24 AM Stephen Boyd <swboyd@...omium.org> wrote:
>
> Quoting Pin-yen Lin (2025-04-28 21:57:16)
> > Hi Stephen,
> >
> > On Tue, Apr 29, 2025 at 7:46 AM Stephen Boyd <swboyd@...omium.org> wrote:
> > >
> > > Quoting Pin-yen Lin (2025-04-22 01:28:29)
> > > > diff --git a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > > index 6577a61cc07531..a020afaf2d6e7a 100644
> > > > --- a/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > > +++ b/Documentation/devicetree/bindings/usb/realtek,rts5411.yaml
> > > > @@ -10,7 +10,7 @@ maintainers:
> > > > - Matthias Kaehlcke <mka@...omium.org>
> > > >
> > > > allOf:
> > > > - - $ref: usb-device.yaml#
> > > > + - $ref: usb-hub.yaml#
> > > >
> > > > properties:
> > > > compatible:
> > > > @@ -19,61 +19,35 @@ properties:
> > > [...]
> > > >
> > > > - port@4:
> > > > - $ref: /schemas/graph.yaml#/properties/port
> > > > - description:
> > > > - 4th downstream facing USB port
> > > > -
> > > > -patternProperties:
> > > > - '^.*@[1-4]$':
> > > > - description: The hard wired USB devices
> > > > - type: object
> > > > - $ref: /schemas/usb/usb-device.yaml
> > > > - additionalProperties: true
> > > > +additionalProperties:
> > > > + properties:
> > > > + reg:
> > > > + minimum: 1
> > > > + maximum: 4
> > >
> > > Is this limiting the 'reg' property of the hub node and not the child
> > > usb-device nodes?
> >
> > Yes, but the regex pattern of patternProperties restricts the
> > downstream device nodes to '^.*@[1-4]$'. So the 'reg's of the child
> > usb-device nodes are also checked.
>
> I'm confused. The path looks like it is removing patternProperties here
> and limiting the reg property of the hub itself so it can only be at
> port 1, 2, 3 or 4. Why is the patternProperties being removed? Don't we
> need to keep the patternProperties around, or somehow get at the
> patternProperties for the hard wired USB devices in the usb-hub schema
> so we can constrain the reg property to be between 1 and 4?
Sorry, I was confused by my own patch... Yes, the patternProperties is
removed in this patch so please ignore my previous mail.
However, it seems that the addtionalProperties here checks all the
properties that are not defined in this yaml file. I tried changing
the node in the example DT to device@...eg=<5>, and make
dt_binding_check rejects the node as expected.
>
> > >
> > > >
> > > > required:
> > > > - peer-hub
> > > > - compatible
> > > > - reg
> > >
> > > Can 'reg' be dropped because usb-hub.yaml requires it?
> >
> > I can drop 'reg' and 'compatible' in the next version, but I see other
> > schemas referencing usb-device.yaml still set 'reg' as required. Is
> > this some kind of convention, or people just didn't notice this?
>
> I assume nobody noticed.
Okay, then I'll update this in the next version.
Pin-yen
Powered by blists - more mailing lists