[PATCH 1/2] dt-bindings: usb: hcd: Add downstream USB ports

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Oct 14 01:31:12 PDT 2026


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?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261014082037.1774672-1-wenst@chromium.org?part=1



More information about the linux-amlogic mailing list