From: sashiko-bot@kernel.org
To: "Marcelo Schmitt" <marcelo.schmitt@analog.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v3 08/13] dt-bindings: iio: adc: adi,ad4134: Document SPI connection mode
Date: Tue, 29 Sep 2026 23:02:26 +0000 [thread overview]
Message-ID: <20260929230226.DDDAE1F00898@smtp.kernel.org> (raw)
In-Reply-To: <12e5af9d96f6c5e800ad860d3cfa6ac8006a22e2.1790719425.git.marcelo.schmitt@analog.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] dt-bindings: validation loophole bypasses #daisy-chained-devices requirement
- [Medium] dt-bindings: malformed YAML const constraint for spi-rx-bus-width array
- [Medium] dt-bindings: missing required enforcement for spi-rx-bus-width in chained mode
--
commit 8253152c0a129fd35b9669cd3adc3c7039f4e2b2
Author: Marcelo Schmitt <marcelo.schmitt@analog.com>
dt-bindings: iio: adc: adi,ad4134: Document SPI connection mode
This commit updates the binding to document how AD4134 chips are connected
to the host SPI controller under different wiring configurations. It
specifies the requirements for daisy-chained SPI modes and corresponding
bus width constraints.
> diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad4134.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad4134.yaml
> index ea6d7e0264190..0b2a2cbfadae8 100644
> --- a/Documentation/devicetree/bindings/iio/adc/adi,ad4134.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad4134.yaml
[ ... ]
> @@ -141,13 +161,30 @@ required:
[ ... ]
> + - oneOf:
> + - required: [adi,spi-mode, '#daisy-chained-devices']
> + properties:
> + adi,spi-mode:
> + const: one-channel-chain
> + spi-rx-bus-width:
> + const: 1
> + - required: [adi,spi-mode, '#daisy-chained-devices']
[Severity: Medium]
Could this regression allow incomplete device trees to pass validation?
In JSON Schema, property value constraints only apply if the property is
actually present in the node instance. Without including spi-rx-bus-width
in the required array for the two-channel-chain branch, a node could omit
the property entirely and bypass the multi-lane constraint, falling back
to an incorrect 1-lane default at runtime.
Should spi-rx-bus-width be added to the required list here?
> + properties:
> + adi,spi-mode:
> + const: two-channel-chain
> + spi-rx-bus-width:
> + const: 1, 1
[Severity: Medium]
Does this YAML constraint evaluation cause a regression where valid inputs
are rejected?
In YAML, const: 1, 1 parses as the literal string "1, 1". Since
spi-rx-bus-width is defined as a uint32-array, the JSON representation is
parsed as an array. Comparing an array against a string using const always
fails.
This would prevent valid hardware descriptions from passing dt_binding_check
validation. Should this be formatted as an explicit array to match the type?
> + - properties:
> + '#daisy-chained-devices': false
[Severity: Medium]
Does this regression in the fallback branch bypass the intended daisy chain
property enforcement?
Using oneOf with a fallback that evaluates '#daisy-chained-devices': false
allows any configuration missing this property to evaluate to true for
this branch.
For instance, if adi,spi-mode is set to one-channel-chain but the daisy
chain property is missing, the schema matches exactly this fallback
subschema. This causes the oneOf requirement to pass entirely, skipping the
intended validation.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1790719424.git.marcelo.schmitt@analog.com?part=8
next prev parent reply other threads:[~2026-09-29 23:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 22:41 [PATCH v3 00/13] iio: adc: ad4134: Enable greater sample rate data capture Marcelo Schmitt
2026-09-29 22:42 ` [PATCH v3 01/13] iio: adc: ad4134: Adjust register map range Marcelo Schmitt
2026-09-29 22:42 ` [PATCH v3 02/13] iio: adc: ad4134: Sign extend sample data Marcelo Schmitt
2026-09-30 8:50 ` Joshua Crofts
2026-09-29 22:42 ` [PATCH v3 03/13] iio: adc: ad4134: Update include list to comply with IWYU principles Marcelo Schmitt
2026-09-29 22:43 ` [PATCH v3 04/13] iio: adc: ad4134: Serialize single-read operations Marcelo Schmitt
2026-09-29 22:52 ` sashiko-bot
2026-09-29 22:43 ` [PATCH v3 05/13] iio: adc: ad4134: Run shorter transfers when CRC is disabled Marcelo Schmitt
2026-09-29 22:43 ` [PATCH v3 06/13] iio: adc: ad4134: Add support for digital filter type selection Marcelo Schmitt
2026-09-29 22:44 ` [PATCH v3 07/13] iio: adc: ad4134: Support buffered data read Marcelo Schmitt
2026-09-29 23:05 ` sashiko-bot
2026-09-30 18:54 ` Marcelo Schmitt
2026-09-29 22:44 ` [PATCH v3 08/13] dt-bindings: iio: adc: adi,ad4134: Document SPI connection mode Marcelo Schmitt
2026-09-29 23:02 ` sashiko-bot [this message]
2026-09-30 18:23 ` Marcelo Schmitt
2026-09-30 11:51 ` Rob Herring (Arm)
2026-09-30 12:15 ` Rob Herring
2026-09-30 22:29 ` Conor Dooley
2026-09-29 22:44 ` [PATCH v3 09/13] dt-bindings: iio: adc: adi,ad4134: Document external multiplexer usage Marcelo Schmitt
2026-09-30 12:16 ` Rob Herring (Arm)
2026-09-29 22:45 ` [PATCH v3 10/13] iio: adc: ad4134: Support SPI 4-wire mode Marcelo Schmitt
2026-09-29 23:08 ` sashiko-bot
2026-09-30 19:39 ` Marcelo Schmitt
2026-09-29 22:45 ` [PATCH v3 11/13] dt-bindings: iio: adc: adi,ad4134: Document PWM usage Marcelo Schmitt
2026-09-29 22:45 ` [PATCH v3 12/13] iio: adc: ad4134: Support high-speed data capture Marcelo Schmitt
2026-09-29 23:16 ` sashiko-bot
2026-09-30 19:59 ` Marcelo Schmitt
2026-09-30 9:42 ` Andy Shevchenko
2026-09-29 22:46 ` [PATCH v3 13/13] Docs: iio: Add AD4134 Marcelo Schmitt
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=20260929230226.DDDAE1F00898@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=marcelo.schmitt@analog.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