Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Joey Lu" <a0987203069@gmail.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v2 1/4] dt-bindings: display: verisilicon,dc: generalize for  single-output variants
Date: Tue, 19 May 2026 06:15:10 +0000	[thread overview]
Message-ID: <20260519061511.57082C2BCFD@smtp.kernel.org> (raw)
In-Reply-To: <20260519055114.1886525-2-a0987203069@gmail.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Missing explicit array length constraints in variant-specific conditional blocks.
- [High] Generic catch-all compatible string enforces SoC-specific limitations and leaves array contents unvalidated.
- [Medium] Incomplete schema topology enforcement allows conflicting 'port' and 'ports' properties.
--

commit e03be5624915d85b3073bbb37ac0fe652c0887cc
Author: Joey Lu <a0987203069@gmail.com>

dt-bindings: display: verisilicon,dc: generalize for single-output variants

This commit updates the verisilicon,dc display controller binding to support
single-output variants like the Verisilicon DCU Lite. It transitions the
schema to use an allOf/if-then-else structure to differentiate between the
existing dual-port th1520-dc8200 and a new generic verisilicon,dc compatible.
The top-level constraints are relaxed, with variant-specific rules intended
to be enforced in the conditional blocks.

> diff --git a/Documentation/devicetree/bindings/display/verisilicon,dc.yaml b/Documentation/devicetree/bindings/display/verisilicon,dc.yaml
> index 9dc35ab973f20..3a814c2e083ee 100644
> --- a/Documentation/devicetree/bindings/display/verisilicon,dc.yaml
> +++ b/Documentation/devicetree/bindings/display/verisilicon,dc.yaml

[ ... ]

> @@ -75,9 +69,75 @@ required:
> -  - ports
>  
> -additionalProperties: false
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: thead,th1520-dc8200
> +    then:
> +      properties:
> +        clocks:
> +          items:
> +            - description: DC Core clock
> +            - description: DMA AXI bus clock
> +            - description: Configuration AHB bus clock
> +            - description: Pixel clock of output 0
> +            - description: Pixel clock of output 1
> +
> +        clock-names:
> +          items:
> +            - const: core
> +            - const: axi
> +            - const: ahb
> +            - const: pix0
> +            - const: pix1
> +
> +        resets:
> +          items:
> +            - description: DC Core reset
> +            - description: DMA AXI bus reset
> +            - description: Configuration AHB bus reset
> +
> +        reset-names:
> +          items:
> +            - const: core
> +            - const: axi
> +            - const: ahb

Does JSON schema validation require explicit minItems and maxItems here to
override the top-level ranges?

At the top level, clocks has minItems: 2 and maxItems: 5, and resets has
minItems: 1 and maxItems: 3. Providing an items array inside a conditional
block does not override those top-level ranges unless explicitly redefined.

Could a device tree node for the thead variant incorrectly pass validation
with only 2 clocks or 1 reset, completely bypassing the intended strict
hardware constraints?

> +
> +      required:
> +        - ports

Since the top-level schema now evaluates the port property globally, should
this branch explicitly forbid it?

Without rejecting port, for example by using properties: { port: false } or
not: { required: [port] }, could a malformed device tree node for the thead
variant define both port and ports simultaneously without triggering a schema
validation error?

> +
> +    else:
> +      properties:
> +        clocks:
> +          items:
> +            - description: Bus clock that gates register access
> +            - description: Pixel clock divider for display timing
> +
> +        clock-names:
> +          items:
> +            - const: core
> +            - const: pix0

The top-level rules allow up to maxItems: 5 for clock-names, but this block
only lists 2 items without setting an explicit maxItems: 2 constraint.

Could a node supply 3 to 5 clocks with unconstrained, undocumented string
names that completely bypass standard schema validation?

> +
> +        resets:
> +          maxItems: 1
> +          description:
> +            Reset line for the display controller.

This branch represents a generic fallback for verisilicon,dc, but caps resets
at 1, which appears to be a Nuvoton-specific constraint.

Will this cause validation failures for future hardware integrations of this
IP that require multiple resets?

Should this binding use a specific compatible string for the Nuvoton hardware,
such as nuvoton,ma35d1-dcu, instead of enforcing these limits on a generic
catch-all string?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260519055114.1886525-1-a0987203069@gmail.com?part=1

  reply	other threads:[~2026-05-19  6:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19  5:51 [PATCH v2 0/4] drm/verisilicon: add Nuvoton MA35D1 DCU Lite support Joey Lu
2026-05-19  5:51 ` [PATCH v2 1/4] dt-bindings: display: verisilicon,dc: generalize for single-output variants Joey Lu
2026-05-19  6:15   ` sashiko-bot [this message]
2026-05-19  7:26   ` [PATCH v2 1/4] dt-bindings: display: verisilicon, dc: " Icenowy Zheng
2026-05-19 16:47     ` Conor Dooley
2026-05-20  3:06       ` Joey Lu
2026-05-20  4:07         ` Icenowy Zheng
2026-05-19  5:51 ` [PATCH v2 2/4] drm/verisilicon: add model ID constants and DCU Lite chip identity Joey Lu
2026-05-19  6:25   ` sashiko-bot
2026-05-19  7:37   ` Icenowy Zheng
2026-05-20  3:08     ` Joey Lu
2026-05-19  5:51 ` [PATCH v2 3/4] drm/verisilicon: introduce per-variant hardware ops table Joey Lu
2026-05-19  6:41   ` sashiko-bot
2026-05-19  5:51 ` [PATCH v2 4/4] drm/verisilicon: add Nuvoton MA35D1 DCU Lite display controller support Joey Lu
2026-05-19  7:17   ` sashiko-bot
2026-05-19  7:44   ` Icenowy Zheng
2026-05-20  3:09     ` Joey Lu

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=20260519061511.57082C2BCFD@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=a0987203069@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@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