Devicetree
 help / color / mirror / Atom feed
From: 李志 <lizhi2@eswincomputing.com>
To: sashiko-reviews@lists.linux.dev
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: Re: [PATCH net-next v8 2/6] dt-bindings: ethernet: eswin: add EIC7700 eth1 RX clock inversion variant
Date: Mon, 15 Jun 2026 16:49:56 +0800 (GMT+08:00)	[thread overview]
Message-ID: <268c0169.9602.19eca791ff2.Coremail.lizhi2@eswincomputing.com> (raw)
In-Reply-To: <20260611013249.E03641F00893@smtp.kernel.org>




> -----Original Messages-----
> From: sashiko-bot@kernel.org
> Send time:Thursday, 11/06/2026 09:32:49
> To: lizhi2@eswincomputing.com
> Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
> Subject: Re: [PATCH net-next v8 2/6] dt-bindings: ethernet: eswin: add EIC7700 eth1 RX clock inversion variant
> 
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] Using a top-level `oneOf` partition for `compatible`-based constraints breaks schema extensibility and violates dt-schema conditional patterns.
> --
> 
> commit c1875936c193e91a73baa1d661559e819f16e710
> Author: Zhi Li <lizhi2@eswincomputing.com>
> 
> dt-bindings: ethernet: eswin: add EIC7700 eth1 RX clock inversion variant
> 
> This commit adds a new compatible string for the EIC7700 eth1 MAC variant
> to handle RX clock inversion requirements. It introduces specific
> tx-internal-delay-ps constraints for each variant using a oneOf block.
> 
> > diff --git a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
> > index 4e02fedae5c67..8cb7545c56e87 100644
> > --- a/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
> > +++ b/Documentation/devicetree/bindings/net/eswin,eic7700-eth.yaml
> 
> [ ... ]
> 
> >  allOf:
> >    - $ref: snps,dwmac.yaml#
> >  
> > +oneOf:
> > +  - properties:
> > +      compatible:
> > +        contains:
> > +          const: eswin,eic7700-qos-eth
> > +      tx-internal-delay-ps:
> > +        minimum: 0
> > +        maximum: 2540
> > +        multipleOf: 20
> > +
> > +  - properties:
> > +      compatible:
> > +        contains:
> > +          const: eswin,eic7700-qos-eth-clk-inversion
> > +      tx-internal-delay-ps:
> > +        minimum: 2000
> > +        maximum: 4540
> > +        multipleOf: 20
> 
> [Severity: Medium]
> According to the device tree bindings subsystem guidelines, YAML binding 
> schemas typically use allOf with if-then blocks to apply different 
> constraints based on the compatible string.
> 
> Does placing a oneOf block at the root level create a mutually-exclusive 
> validation partition that will break schema extensibility? 
> 
> If a new compatible string is added to the enum in the future, it looks 
> like it might fail the entire oneOf block by not matching either arm, 
> causing the whole document to fail validation.
> 
> Could this be rewritten using allOf and if-then conditionals?
> 
> [ ... ]
> 
> > @@ -67,11 +89,6 @@ properties:
> >      maximum: 2540
> >      multipleOf: 20
> >  
> > -  tx-internal-delay-ps:
> > -    minimum: 0
> > -    maximum: 2540
> > -    multipleOf: 20
> > -
> >    eswin,hsp-sp-csr:
> >      description:
> >        HSP CSR is to control and get status of different high-speed peripherals
> 
> [Severity: Medium]
> Is it intended to remove tx-internal-delay-ps entirely from the main 
> properties block? 
> 
> Removing the property from the root properties block is usually considered 
> a schema anti-pattern. Should the base property definition remain here, 
> with only the range constraints being overridden in the conditional blocks 
> above?
> 
> -- 
I am planning to switch the schema from a top-level oneOf
to an allOf + if/then based approach.

The idea is to:
- define a global tx-internal-delay-ps range in properties (0–4540 ps)
- then apply per-compatible constraints using if/then:
- eswin,eic7700-qos-eth: max 2540 ps
- eswin,eic7700-qos-eth-clk-inversion: min 2000 ps

Does this align with the preferred dt-schema pattern for
modeling variant-specific constraints, compared to using oneOf?

  reply	other threads:[~2026-06-15  8:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10  1:27 [PATCH net-next v8 0/6] net: stmmac: eic7700: add eth1 variant support and update delay bindings lizhi2
2026-06-10  1:28 ` [PATCH net-next v8 1/6] dt-bindings: ethernet: eswin: relax internal delay model to range-based constraints lizhi2
2026-06-12 16:28   ` Rob Herring (Arm)
2026-06-10  1:29 ` [PATCH net-next v8 2/6] dt-bindings: ethernet: eswin: add EIC7700 eth1 RX clock inversion variant lizhi2
2026-06-11  1:32   ` sashiko-bot
2026-06-15  8:49     ` 李志 [this message]
2026-06-10  1:29 ` [PATCH net-next v8 3/6] net: stmmac: eic7700: make RGMII delay properties optional lizhi2
2026-06-10  8:26   ` Maxime Chevallier
2026-06-13  7:48     ` Andrew Lunn
2026-06-10  1:31 ` [PATCH net-next v8 4/6] net: stmmac: eic7700: add support for eth1 clock inversion variant lizhi2
2026-06-10  1:32 ` [PATCH net-next v8 5/6] dt-bindings: mfd: syscon: add ESWIN EIC7700 compatible lizhi2
2026-06-10  1:32 ` [PATCH net-next v8 6/6] riscv: dts: eswin: eic7700-hifive-premier-p550: enable Ethernet controller lizhi2
2026-06-11  1:32   ` sashiko-bot
2026-06-15  9:08     ` 李志

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=268c0169.9602.19eca791ff2.Coremail.lizhi2@eswincomputing.com \
    --to=lizhi2@eswincomputing.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