From: sashiko-bot@kernel.org
To: "Thierry Reding" <thierry.reding@kernel.org>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v5 1/4] dt-bindings: pci: Strictly distinguish C0 from C1-C5
Date: Tue, 26 May 2026 09:15:26 +0000 [thread overview]
Message-ID: <20260526091527.9F8341F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260526-tegra264-pcie-v5-1-84a813b979d7@nvidia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `oneOf` conditional branches for C0 and C1-C5 controllers fail to specify `minItems` and `maxItems` for `reg` and `reg-names`, allowing incorrect array lengths to pass schema validation.
--
commit e94ac7315673fefb739d35acd2b3406eaf80cdbc
Author: Thierry Reding <treding@nvidia.com>
dt-bindings: pci: Strictly distinguish C0 from C1-C5
This commit strictly distinguishes the C0 controller from the C1-C5
controllers in the Tegra264 PCIe binding. It updates the register lists
and names for each variant under an allOf oneOf block to match the
hardware correctly.
> diff --git a/Documentation/devicetree/bindings/pci/nvidia,tegra264-pcie.yaml b/Documentation/devicetree/bindings/pci/nvidia,tegra264-pcie.yaml
> index dc4f8725c9f59..acb677d477fb3 100644
> --- a/Documentation/devicetree/bindings/pci/nvidia,tegra264-pcie.yaml
> +++ b/Documentation/devicetree/bindings/pci/nvidia,tegra264-pcie.yaml
[ ... ]
> properties:
> compatible:
> const: nvidia,tegra264-pcie
>
> reg:
> minItems: 4
> + maxItems: 5
>
> reg-names:
> minItems: 4
> + maxItems: 5
[ ... ]
> @@ -70,6 +61,40 @@ required:
>
> allOf:
> - $ref: /schemas/pci/pci-host-bridge.yaml#
> + - oneOf:
> + - description: C0 controller (no UPHY)
> + properties:
> + reg:
> + items:
> + - description: application layer registers
> + - description: transaction layer registers
> + - description: privileged transaction layer registers
> + - description: ECAM compatible configuration space
> +
> + reg-names:
> + items:
> + - const: xal
> + - const: xtl
> + - const: xtl-pri
> + - const: ecam
[Severity: Medium]
Will this schema fully enforce the register counts for each variant?
Since JSON schema tuple validation only evaluates elements present up to the
length of the instance array, it does not enforce bounds on the length unless
minItems and maxItems are explicitly provided in these conditional branches.
Because the top-level schema permits minItems: 4 and maxItems: 5, a C0 node
providing 5 registers might incorrectly pass validation against the C0 branch.
The first 4 items match the items list, the 5th item is unconstrained by the
C0 branch, and the array satisfies the top-level maxItems: 5.
Similarly, a C1-C5 node providing only 4 registers could pass the C1-C5
branch below. The 5th constraint would never be evaluated on a 4-item array,
and the array would satisfy the top-level minItems: 4.
Should explicit minItems: 4 and maxItems: 4 be added to the C0 properties
block, along with minItems: 5 and maxItems: 5 for the C1-C5 properties block,
to ensure the strict distinction mentioned in the commit message?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260526-tegra264-pcie-v5-0-84a813b979d7@nvidia.com?part=1
next prev parent reply other threads:[~2026-05-26 9:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-26 8:53 [PATCH v5 0/4] PCI: tegra: Add Tegra264 support Thierry Reding
2026-05-26 8:53 ` [PATCH v5 1/4] dt-bindings: pci: Strictly distinguish C0 from C1-C5 Thierry Reding
2026-05-26 9:15 ` sashiko-bot [this message]
2026-05-26 8:53 ` [PATCH v5 2/4] PCI: Use standard wait times for PCIe link monitoring Thierry Reding
2026-05-26 11:10 ` Lukas Wunner
2026-05-27 8:28 ` Thierry Reding
2026-05-27 17:22 ` Lukas Wunner
2026-05-26 8:53 ` [PATCH v5 3/4] PCI: tegra: Add Tegra264 support Thierry Reding
2026-05-26 9:58 ` sashiko-bot
2026-05-27 8:12 ` Thierry Reding
2026-05-26 8:53 ` [PATCH v5 4/4] arm64: tegra: Reorder reg and reg-names to match bindings Thierry Reding
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=20260526091527.9F8341F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=thierry.reding@kernel.org \
/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