Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Minda Chen" <minda.chen@starfivetech.com>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
	devicetree@vger.kernel.org
Subject: Re: [net-next v3 3/5] dt-bindings: net: starfive,jh7110-dwmac: Add jhb100 sgmii rx clk
Date: Fri, 08 May 2026 17:14:50 +0000	[thread overview]
Message-ID: <20260508171451.62106C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260507094115.8355-4-minda.chen@starfivetech.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] The patch erroneously relaxes clock constraints for the base `starfive,jh7110-dwmac` hardware, incorrectly allowing it to specify 6 clocks.
- [Low] Replacing the global `items` array for `clock-names` with duplicated conditional blocks is a binding anti-pattern.
--

commit 868beb354c5de56282a3dbb82e7d79b8745d272e
Author: Minda Chen <minda.chen@starfivetech.com>

dt-bindings: net: starfive,jh7110-dwmac: Add jhb100 sgmii rx clk

This commit updates the starfive,jh7110-dwmac binding to support the jhb100
SGMII interface. It adds a 6th clock for the new SGMII interface while
noting that existing RMII/RGMII interfaces still use 5 clocks.

> --- a/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/starfive,jh7110-dwmac.yaml
> @@ -39,20 +39,18 @@ properties:
[ ... ]
>    clock-names:
> -    items:
> -      - const: stmmaceth
> -      - const: pclk
> -      - const: ptp_ref
> -      - const: tx
> -      - const: gtx
> +    minItems: 5
> +    maxItems: 6

This isn't a bug, but does it make sense to keep the full 6-element list
defined here at the top level and rely purely on minItems and maxItems
overrides inside the conditional blocks?

Standard device tree binding practice usually defines the complete items array
once at the top level. By removing the items array here and moving it into
the conditionals, the string constants are duplicated across multiple blocks.

[ ... ]
> @@ -111,6 +121,26 @@ allOf:
>            contains:
>              const: starfive,jh7110-dwmac
>      then:
> +      properties:
> +        clocks:
> +          minItems: 5
> +          maxItems: 6
> +
> +        clock-names:
> +          oneOf:
> +            - items:
> +                - const: stmmaceth
> +                - const: pclk
> +                - const: ptp_ref
> +                - const: tx
> +                - const: gtx
> +            - items:
> +                - const: stmmaceth
> +                - const: pclk
> +                - const: ptp_ref
> +                - const: tx
> +                - const: gtx
> +                - const: sgmii_rx

Does this inadvertently relax the clock constraints for the base
starfive,jh7110-dwmac hardware?

The commit message explicitly states that the 6th clock is a requirement
only for the new jhb100 SGMII interface, while other interfaces use 5 clocks.

Since jhb100 uses starfive,jh7110-dwmac as a fallback, this outer then
block applies to both hardware variants. Because there is no inner else
block for the pure starfive,jh7110-dwmac to restrict maxItems back to 5,
will a pure jh7110 device tree now be erroneously permitted to specify 6
clocks and silently pass schema validation?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260507094115.8355-1-minda.chen@starfivetech.com?part=3

  parent reply	other threads:[~2026-05-08 17:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07  9:41 [net-next v3 0/5] Add StarFive jhb100 soc SGMII GMAC support Minda Chen
2026-05-07  9:41 ` [net-next v3 1/5] dt-bindings: net: starfive,jh7110-dwmac: Remove jh8100 Minda Chen
2026-05-07 12:31   ` Andrew Lunn
2026-05-07 17:36   ` Conor Dooley
2026-05-07  9:41 ` [net-next v3 2/5] dt-bindings: net: starfive,jh7110-dwmac: Add jhb100 support Minda Chen
2026-05-08 17:14   ` sashiko-bot
2026-05-07  9:41 ` [net-next v3 3/5] dt-bindings: net: starfive,jh7110-dwmac: Add jhb100 sgmii rx clk Minda Chen
2026-05-07 17:42   ` Conor Dooley
2026-05-08 17:14   ` sashiko-bot [this message]
2026-05-07  9:41 ` [net-next v3 4/5] net: stmmac: starfive: Add jhb100 SGMII interface Minda Chen
2026-05-07 12:41   ` Andrew Lunn
2026-05-08  9:35     ` Minda Chen
2026-05-07 17:44   ` Conor Dooley
2026-05-08  9:35     ` Minda Chen
2026-05-07  9:41 ` [net-next v3 5/5] net: stmmac: starfive: Add STMMAC_FLAG_SPH_DISABLE flag Minda Chen
2026-05-07 12:42   ` Andrew Lunn
2026-05-07 12:31 ` [net-next v3 0/5] Add StarFive jhb100 soc SGMII GMAC support Andrew Lunn

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=20260508171451.62106C2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=minda.chen@starfivetech.com \
    --cc=robh@kernel.org \
    --cc=sashiko@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