[PATCH 1/2] dt-bindings: usb: hcd: Add downstream USB ports
Chen-Yu Tsai
wenst at chromium.org
Wed Oct 14 03:16:51 PDT 2026
On Wed, Oct 14, 2026 at 5:31 PM <sashiko-bot at kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] dt-bindings: usb: port at 0 schema constraint bypassed
> --
>
> commit aaa6107663f4d524c266c3a18264c416a86a4bb4
> Author: Chen-Yu Tsai <wenst at chromium.org>
>
> dt-bindings: usb: hcd: Add downstream USB ports
>
> This commit adds a "ports" child node to the USB HCD binding to support
> connecting downstream USB connector nodes via OF graph. It attempts to enforce
> that USB downstream port numbers start at 1, and updates the address matching
> for hard-wired downstream devices.
>
> > diff --git a/Documentation/devicetree/bindings/usb/usb-hcd.yaml b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > index 45a19d4928afa..24df99dfb243c 100644
> > --- a/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > +++ b/Documentation/devicetree/bindings/usb/usb-hcd.yaml
> > @@ -29,8 +29,16 @@ properties:
> > "#size-cells":
> > const: 0
> >
> > + ports:
> > + $ref: /schemas/graph.yaml#/properties/ports
> > + description: The downstream facing USB ports
> > +
> > + patternProperties:
> > + "^port@[1-9a-f][0-9a-f]?$":
> > + $ref: /schemas/graph.yaml#/properties/port
>
> [Severity: Medium]
> Does this local constraint actually prevent port at 0 from passing validation?
>
> Since JSON schema patternProperties only restrict matching nodes, a
> non-matching node like port at 0 will fall back to the generic graph.yaml
> reference.
>
> Because graph.yaml evaluates anything matching ^port(@.*)?$, wouldn't
> port at 0 be evaluated as valid and silently pass, completely bypassing the
> intent that downstream port numbers start at 1?
I suspect I need to write it as:
ports:
properties:
port at 0: false
patternProperties:
"^port@[1-9a-f][0-9a-f]?$": ...
More information about the linux-amlogic
mailing list