All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Qianhui Xu" <xiaqinghuan@mail.ustc.edu.cn>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v14 1/3] dt-bindings: usb: snps,dwc3: describe two connectors on one HS data bus
Date: Tue, 24 Nov 2026 02:02:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-230368@kernel.org> (raw)
In-Reply-To: <20261124015002.1426767-2-xiaqinghuan@mail.ustc.edu.cn>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Low] dt-bindings: usb: snps,dwc3: incomplete endpoint schema under
  port@0
- [Low] dt-bindings: usb: snps,dwc3: inter-version changelog above
  tearline
--

commit 30bef4a2b887532802ddeda2f9088011cea77c35
Author: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>

dt-bindings: usb: snps,dwc3: describe two connectors on one HS data bus

This commit extends the DWC3 common DT binding to describe two USB
connectors multiplexed onto a single High Speed data bus via mux-controls
and endpoint@0/endpoint@1 under port@0.

> Signed-off-by: Qianhui Xu <xiaqinghuan@mail.ustc.edu.cn>
>
> Changes since v13:
>  - [sashiko, 2026-11-23, Low] "missing maxItems: 1 on mux-controls".
>    Accepted: the shared data bus is driven by one two-state multiplexer, so
>    "mux-controls" now says "maxItems: 1" instead of leaving the number of
>    mux controllers open.

[Severity: Low]
Should the "Changes since v13:" block be placed below the "---" separator
so it is not recorded in the permanent git commit log?

> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
> index 6c0b8b6538246..dcfa8c3a81c51 100644
> --- a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
> @@ -26,8 +26,78 @@ allOf:
>        $ref: usb.yaml#
>      else:
>        $ref: usb-xhci.yaml#
> +  - if:
> +      required: [mux-controls]
> +    then:
> +      # A multiplexed High Speed bus only makes sense when the controller is
> +      # dual-role and both connectors can switch their role independently.
> +      required: [ports, usb-role-switch]
> +      properties:
> +        dr_mode:
> +          const: otg
> +        ports:
> +          required: [port@0]
> +          properties:
> +            port@0:
> +              required: ['#address-cells', '#size-cells',
> +                         endpoint@0, endpoint@1]
> +              # A mux'ed High Speed bus has exactly two connectors, as the
> +              # two endpoints of this port; a plain "endpoint" or any further
> +              # endpoint would be a third data stream and is not described.
> +              properties:
> +                endpoint: false
> +              patternProperties:
> +                '^endpoint@[01]$':
> +                  required: [usb-role-switch, mux-state]
> +                '^endpoint@([2-9]|[1-9a-f][0-9a-f]+)$': false

[ ... ]

> +    else:
> +      # Without a mux the High Speed port keeps the generic graph port
> +      # binding, so single-connector controllers are described as before and
> +      # the per-connector properties have no meaning.
> +      properties:
> +        ports:
> +          properties:
> +            port@0:
> +              patternProperties:
> +                '^endpoint@[01]$':
> +                  properties:
> +                    usb-role-switch: false
> +                    mux-state: false

[ ... ]

> @@ -411,9 +481,37 @@ properties:
>  
>      properties:
>        port@0:
> -        $ref: /schemas/graph.yaml#/properties/port
> +        # The High Speed port carries the controller's HS data stream.  Two
> +        # receptacles sharing one HS D+/D- pair are two mux'ed data streams of
> +        # that one stream, so they are two endpoints of this port and not two
> +        # ports.  A single-connector controller describes the plain "endpoint"
> +        # of the graph binding and is unaffected.
> +        $ref: /schemas/graph.yaml#/$defs/port-base
> +        unevaluatedProperties: false
>          description: High Speed (HS) data bus.
>  
> +        patternProperties:
> +          '^endpoint@[01]$':
> +            $ref: /schemas/graph.yaml#/$defs/endpoint-base
> +            unevaluatedProperties: false

[Severity: Low]
Does switching port@0 from /schemas/graph.yaml#/properties/port to
$defs/port-base drop unevaluatedProperties: false validation for plain
port@0/endpoint nodes when mux-controls is absent?

$defs/port-base matches ^endpoint(@[0-9a-f]+)?$ against
$defs/endpoint-base, which intentionally omits unevaluatedProperties:
false, and port@0 only sets unevaluatedProperties: false on
^endpoint@[01]$.  When mux-controls is absent, the else branch only
forbids usb-role-switch and mux-state on ^endpoint@[01]$, so a plain
port@0/endpoint node (or endpoint@2+) on a single-connector controller
accepts undocumented properties.  Also, in the mux-controls branch, the
pattern '^endpoint@([2-9]|[1-9a-f][0-9a-f]+)$': false omits single-digit
hexadecimal unit addresses a-f, allowing endpoint@a through endpoint@f.

Referencing $ref: /schemas/graph.yaml#/properties/port under port@0 in
the else branch and changing [2-9] to [2-9a-f] in the then branch pattern
would close both gaps.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124015002.1426767-1-xiaqinghuan@mail.ustc.edu.cn?part=1

  reply	other threads:[~2026-11-24  2:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24  1:49 [PATCH v14 0/3] usb: dwc3: support two connectors sharing one HS data bus Qianhui Xu
2026-11-24  1:50 ` [PATCH v14 1/3] dt-bindings: usb: snps,dwc3: describe two connectors on " Qianhui Xu
2026-11-24  2:02   ` sashiko-bot [this message]
2026-11-24  1:50 ` [PATCH v14 2/3] usb: roles: look up role switches attached to a graph endpoint Qianhui Xu
2026-11-24  1:50 ` [PATCH v14 3/3] usb: dwc3: select the shared HS data bus with a mux controller Qianhui Xu
2026-11-24  7:14 ` [PATCH v14 0/3] usb: dwc3: support two connectors sharing one HS data bus Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2026-11-24  4:52 Qianhui Xu
2026-11-24  4:52 ` [PATCH v14 1/3] dt-bindings: usb: snps,dwc3: describe two connectors on " Qianhui Xu
2026-11-24  5:04   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-230368@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=xiaqinghuan@mail.ustc.edu.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.