All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Bhargav Joshi" <j.bhargav.u@gmail.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v2 2/2] dt-bindings: spi: ti,davinci-spi: convert to DT schema
Date: Sat, 15 Aug 2026 22:31:26 +0000	[thread overview]
Message-ID: <20260815223126.7A49C1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260816-ti-davinci-spi-v2-2-6c6f5171422b@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Schema validation conditional uses `const` instead of `contains: const`, bypassing requirements for compatible string arrays.
--

--- Patch [2]: [PATCH v2 2/2] dt-bindings: spi: ti,davinci-spi: convert to DT schema ---
commit d0abc65d99912b6ce06eea7206590c61cb52b6de
Author: Bhargav Joshi <j.bhargav.u@gmail.com>

dt-bindings: spi: ti,davinci-spi: convert to DT schema

This commit converts the TI DaVinci/Keystone SPI controller binding from text
format to DT schema. It creates a separate schema for peripheral properties,
adds missing DMA properties, and introduces constraints to the ti,spi-wdelay
property.

> diff --git a/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml b/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml
> new file mode 100644
> index 0000000000000..b685082de721c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/ti,davinci-spi.yaml

[ ... ]

> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - ti,davinci-spi-intr-line
> +
> +allOf:
> +  - $ref: spi-controller.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          const: ti,keystone-spi

[Severity: Medium]
Should this use contains: const instead of just const?

Because dt-schema evaluates this strictly based on JSON Schema rules, an array
value will not match the scalar const. As a result, when the compatible
property is an array, this conditional is bypassed.

This allows device tree configurations to silently pass dt_binding_check even
if they erroneously omit the mandatory power-domains property.

> +    then:
> +      required:
> +        - power-domains
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    spi@20bf0000 {
> +        compatible = "ti,keystone-spi","ti,dm6441-spi";
> +        reg = <0x20bf0000 0x1000>;
> +        num-cs = <4>;
> +        ti,davinci-spi-intr-line = <0>;
> +        interrupts = <338>;
> +        clocks = <&clkspi>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;

Does the lack of contains: const explain why this example passes validation
despite omitting the power-domains property?

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260816-ti-davinci-spi-v2-0-6c6f5171422b@gmail.com?part=2

      reply	other threads:[~2026-08-15 22:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-15 22:23 [PATCH v2 0/2] spi: davinci: Convert bindings to DT schema and clean up DTS Bhargav Joshi
2026-08-15 22:23 ` [PATCH v2 1/2] ARM: dts: ti: keystone-k2l: Rename ti,davinci-spi-num-cs to num-cs Bhargav Joshi
2026-08-15 22:23 ` [PATCH v2 2/2] dt-bindings: spi: ti,davinci-spi: convert to DT schema Bhargav Joshi
2026-08-15 22:31   ` sashiko-bot [this message]

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=20260815223126.7A49C1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=j.bhargav.u@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.