From: sashiko-bot@kernel.org
To: "Dmitry Baryshkov" <dmitry.baryshkov@oss.qualcomm.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: usb: qcom,pmic-types: require one of the VBUS sources
Date: Sun, 20 Sep 2026 14:44:21 +0000 [thread overview]
Message-ID: <20260920144421.9FEE41F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260920-fix-tcpm-vbus-bis-v1-1-cc9347bbe81a@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dt-bindings: broken oneOf logic erroneously rejects valid legacy nodes
--
commit 91a069f510352e4c4e88b45ca0d906bfa22ef623
Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
dt-bindings: usb: qcom,pmic-types: require one of the VBUS sources
This commit attempts to enforce that either the generic vbus-supply inside
a connector node or the legacy vdd-vbus-supply is provided. It adds a oneOf
constraint to check for either the old property or the generic property
inside the connector node.
> diff --git a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> --- a/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> +++ b/Documentation/devicetree/bindings/usb/qcom,pmic-typec.yaml
> @@ -91,6 +91,14 @@ required:
> - interrupts
> - interrupt-names
>
> +oneOf:
> + - required:
> + - vdd-vbus-supply
> + - properties:
> + connector:
> + required:
> + - vbus-supply
[Severity: Medium]
Does this logic mistakenly reject valid legacy nodes and allow missing vbus
supplies?
The JSON Schema properties keyword only applies constraints if the property
exists in the instance. If the connector node is omitted entirely, the
second branch of the oneOf block will vacuously evaluate to true.
If neither vbus property is present, the first branch is false, but the
second branch is true, meaning the oneOf constraint passes. This silently
allows nodes missing vbus supplies.
Conversely, if a valid legacy node provides vdd-vbus-supply but has no
connector node, both the first branch and the second branch evaluate to
true. Because oneOf strictly requires exactly one branch to be true, it
fails validation and erroneously rejects valid legacy configurations.
Should the second branch use a required constraint for the connector node to
prevent this issue?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260920-fix-tcpm-vbus-bis-v1-0-cc9347bbe81a@oss.qualcomm.com?part=1
next prev parent reply other threads:[~2026-09-20 14:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-20 14:37 [PATCH 0/2] dt-bindings: usb: qcom,pmic-typec: two small fixes Dmitry Baryshkov
2026-09-20 14:37 ` [PATCH 1/2] dt-bindings: usb: qcom,pmic-types: require one of the VBUS sources Dmitry Baryshkov
2026-09-20 14:44 ` sashiko-bot [this message]
2026-09-20 21:22 ` Bryan O'Donoghue
2026-09-20 14:37 ` [PATCH 2/2] dt-bindings: usb: qcom,pmic-types: make example use generic VBUS property Dmitry Baryshkov
2026-09-20 14:43 ` sashiko-bot
2026-09-20 21:21 ` Bryan O'Donoghue
2026-09-24 13:01 ` Krzysztof Kozlowski
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=20260920144421.9FEE41F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--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