mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
To: linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, marcelo.schmitt1@gmail.com
Cc: Marcelo Schmitt <marcelo.schmitt@analog.com>,
	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: Wed, 30 Sep 2026 15:23:05 -0300	[thread overview]
Message-ID: <ar1TiXPQSO3xCp6B@debian-BULLSEYE-live-builder-AMD64> (raw)
In-Reply-To: <20260929230226.DDDAE1F00898@smtp.kernel.org>

On 09/29, sashiko-bot@kernel.org wrote:
...
> > @@ -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?

I'll do so and further test dt_binding_check catches any invalid combination
of properties and values.

> 
> > +        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?

Will fix that following the suggestion from Rob's review.

> 
> > +      - 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.

Will double check that and, if needed, change how the constraints are written.

  parent reply	other threads:[~2026-09-30 18:22 UTC|newest]

Thread overview: 24+ 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: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
     [not found]   ` <20260929230528.8861C1F000FF@smtp.kernel.org>
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-30 11:51   ` Rob Herring (Arm)
2026-09-30 12:15   ` Rob Herring
     [not found]   ` <20260929230226.DDDAE1F00898@smtp.kernel.org>
2026-09-30 18:23     ` Marcelo Schmitt [this message]
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
     [not found]   ` <20260929230830.A8F3A1F000FF@smtp.kernel.org>
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-30  9:42   ` Andy Shevchenko
     [not found]   ` <20260929231610.BA7C31F000FF@smtp.kernel.org>
2026-09-30 19:59     ` Marcelo Schmitt
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=ar1TiXPQSO3xCp6B@debian-BULLSEYE-live-builder-AMD64 \
    --to=marcelo.schmitt1@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.schmitt@analog.com \
    --cc=robh@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

all inboxes | Powered by JetHome®