Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ariana Lazar" <ariana.lazar@microchip.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v4 2/3] dt-bindings: iio: adc: add support for PAC1711
Date: Wed, 07 Oct 2026 14:50:47 +0000	[thread overview]
Message-ID: <sashiko-outbox-163121@kernel.org> (raw)
In-Reply-To: <20261007-pac1711-v4-2-6ef34d7a7947@microchip.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] dt-bindings: missing `contains:` in `compatible` property matching causes conflicting constraints
--

commit fc07b1cc31cfe375fd7611b7a1adec3398c98d59
Author: Ariana Lazar <ariana.lazar@microchip.com>

dt-bindings: iio: adc: add support for PAC1711

This commit introduces device tree schema for the Microchip PAC1711, PAC1721,
PAC1811, and PAC1821 single-channel power monitors. It outlines the required
and optional properties, including accumulation sources and voltage ranges.

> diff --git a/Documentation/devicetree/bindings/iio/adc/microchip,pac1711.yaml b/Documentation/devicetree/bindings/iio/adc/microchip,pac1711.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/microchip,pac1711.yaml
[ ... ]
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          pattern: "^microchip,pac1[78]11$"

[Severity: High]
In device tree bindings, the compatible property is evaluated as an array
of strings. Since the JSON Schema pattern keyword is restricted to string
instances, applying it directly to an array instance causes it to be ignored
and unconditionally evaluate to true.

Will this cause the condition to evaluate to true for all device tree
instances? Should this use the contains keyword instead, such as
properties: compatible: contains: { pattern: "^microchip,pac1[78]11$" } ?

> +    then:
> +      properties:
> +        microchip,vbus-input-range-microvolt:
[ ... ]
> +  - if:
> +      properties:
> +        compatible:
> +          pattern: "^microchip,pac1[78]21$"

[Severity: High]
Because both this conditional block and the previous one apply pattern
directly to the compatible property instead of using contains, both conditions
will simultaneously evaluate to true.

Does this result in mutually exclusive constraints being applied to
microchip,vbus-input-range-microvolt simultaneously? If the schema demands
the array simultaneously match both the 42V and 9V constraints, won't this
cause dt_binding_check validation to fail even for valid device trees like
the provided example?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261007-pac1711-v4-0-6ef34d7a7947@microchip.com?part=2

  reply	other threads:[~2026-10-07 14:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-07 14:41 [PATCH v4 0/3] Add support for Microchip PAC1711 Power Monitor Ariana Lazar
2026-10-07 14:41 ` [PATCH v4 1/3] iio: core: add IIO_CHARGE channel type Ariana Lazar
2026-10-07 14:49   ` sashiko-bot
2026-10-07 14:41 ` [PATCH v4 2/3] dt-bindings: iio: adc: add support for PAC1711 Ariana Lazar
2026-10-07 14:50   ` sashiko-bot [this message]
2026-10-07 20:47   ` Rob Herring (Arm)
2026-10-07 14:41 ` [PATCH v4 3/3] " Ariana Lazar
2026-10-07 14:54   ` sashiko-bot
2026-10-08 16:46   ` kernel test robot

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-163121@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=ariana.lazar@microchip.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-hwmon@vger.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