From: sashiko-bot@kernel.org
To: "Pawel Laszczak via B4 Relay" <devnull+pawell.cadence.com@kernel.org>
Cc: devicetree@vger.kernel.org, krzk+dt@kernel.org, robh@kernel.org,
conor+dt@kernel.org
Subject: Re: [PATCH v7 1/2] dt-bindings: usb: cdns3: Add cdns,no-drd property
Date: Thu, 14 May 2026 12:30:54 +0000 [thread overview]
Message-ID: <20260514123054.809BDC2BCB3@smtp.kernel.org> (raw)
In-Reply-To: <20260514-b4-no_drd_config-v7-1-18cc40e363fd@cadence.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] The schema fails to enforce that `dr_mode` is required when `cdns,no-drd` is present.
- [Medium] The conditional blocks enforce strict array ordering for `reg-names`, directly contradicting the commit message's claim of supporting flexible ordering.
- [Medium] The `if/then/else` logic fails to fully enforce array length constraints for `reg` and `reg-names`, breaking backward compatibility and allowing invalid configurations.
--
commit 27ad576607394b6bdaff814912f5101ce8966dd5
Author: Pawel Laszczak <pawell@cadence.com>
dt-bindings: usb: cdns3: Add cdns,no-drd property
This commit introduces the cdns,no-drd property for Cadence USB controllers
where the dual-role device register block is missing or inaccessible. It
updates the schema to conditionally modify the requirements for reg,
reg-names, interrupts, and dr_mode based on whether this property is present.
> diff --git a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> --- a/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
> +++ b/Documentation/devicetree/bindings/usb/cdns,usb3.yaml
[ ... ]
> @@ -93,6 +98,45 @@ allOf:
> - $ref: usb-drd.yaml#
> - $ref: usb-xhci.yaml#
>
> + - if:
> + required:
> + - cdns,no-drd
> + then:
> + properties:
> + reg:
> + items:
> + - description: XHCI Host controller registers
> + - description: DEVICE controller registers
Since the top-level schema relaxes maxItems to 3, does this then block
need an explicit maxItems of 2 for reg?
In JSON schema, defining an items list inside a conditional block does not
implicitly restrict the maximum length, which could allow an invalid third
register item to silently pass validation.
> + reg-names:
> + items:
> + - const: xhci
> + - const: dev
The commit message states reg-names uses enums to allow flexible ordering
during validation. However, does defining items as an array of constants in
this block enforce a strict positional sequence?
Tuple validation requires xhci to be the first element and dev to be the
second, which seems to contradict the intended flexibility.
Similarly, does this block also need an explicit maxItems of 2 to match
the expected length?
> + interrupts:
> + maxItems: 2
> + interrupt-names:
> + items:
> + - const: host
> + - const: peripheral
> + dr_mode:
> + enum: [host, peripheral]
The commit message notes dr_mode must be explicitly set to either host or
peripheral. Does the then block need a required list containing dr_mode to
enforce this?
Currently, the schema restricts the allowed values but will still pass
validation if a device tree node omits dr_mode entirely.
> + else:
> + properties:
> + reg:
> + items:
> + - description: OTG controller registers
> + - description: XHCI Host controller registers
> + - description: DEVICE controller registers
> + reg-names:
> + items:
> + - const: otg
> + - const: xhci
> + - const: dev
Just like in the then block, does defining items as an array of constants
here prevent flexible ordering by enforcing otg, xhci, and dev in that
exact sequence?
Also, since the top-level schema was relaxed to allow a minimum of 2 items,
do reg and reg-names need an explicit minItems of 3 here?
Without it, an array of just 2 items could pass validation when cdns,no-drd
is absent, which breaks the intended backward compatibility of requiring all
3 resource sets.
> + interrupts:
> + minItems: 3
> + maxItems: 4
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260514-b4-no_drd_config-v7-0-18cc40e363fd@cadence.com?part=1
next prev parent reply other threads:[~2026-05-14 12:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 6:00 [PATCH v7 0/2] usb: cdns3: support configurations without DRD block Pawel Laszczak via B4 Relay
2026-05-14 6:00 ` [PATCH v7 1/2] dt-bindings: usb: cdns3: Add cdns,no-drd property Pawel Laszczak via B4 Relay
2026-05-14 12:30 ` sashiko-bot [this message]
2026-05-14 13:39 ` Rob Herring
2026-05-14 6:00 ` [PATCH v7 2/2] usb: cdnsp: Add support for device-only configuration Pawel Laszczak via B4 Relay
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=20260514123054.809BDC2BCB3@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=devnull+pawell.cadence.com@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox