linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: wsa+renesas <wsa+renesas@sang-engineering.com>,
	Biju Das <biju.das.jz@bp.renesas.com>,
	"linux-renesas-soc@vger.kernel.org"
	<linux-renesas-soc@vger.kernel.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	"magnus.damm" <magnus.damm@gmail.com>,
	"linux-watchdog@vger.kernel.org" <linux-watchdog@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog
Date: Thu, 9 Oct 2025 15:00:54 -0500	[thread overview]
Message-ID: <20251009200054.GA3245555-robh@kernel.org> (raw)
In-Reply-To: <CAMuHMdVUbENsdjCCqrn7e9=mWbs+J1kcat6LYU6vAcrBHzawBw@mail.gmail.com>

On Mon, Oct 06, 2025 at 11:25:11AM +0200, Geert Uytterhoeven wrote:
> Hi Wolfram,
> 
> On Mon, 6 Oct 2025 at 08:30, wsa+renesas
> <wsa+renesas@sang-engineering.com> wrote:
> > > > > > +      - enum:
> > > > > > +          - renesas,r9a09g057-wdt    # RZ/V2H(P)
> > > > > > +          - renesas,r9a09g077-wdt    # RZ/T2H
> > > > > > +
> > > > > > +      - items:
> > > > > > +          - const: renesas,r9a09g087-wdt # RZ/N2H
> > > > > > +          - const: renesas,r9a09g077-wdt # RZ/T2H
> > >
> > > I guess a comment like # fallback RZ/T2H here will avoid confusion.
> >
> > Hmmm, if we add such a comment for every fallback, this will be quite
> > some churn, I would think. My favourite solution would be to swap the
> > 'items' entry with the 'enum'. So, everything with a fallback comes
> > first, and the 'plain' entries last. But what do others think?

That's probably what I'd pick, but I try not to define rules we can't 
check with tools. Otherwise, I get tired of having to review that rule. 

And adding a rule to tools has the cost of fixing the existing cases 
everywhere.

> We do have "fallback" comments in other places, and I think they do
> help in understanding compatible naming schemes.
> 
> Would it be possible to handle this in dt-schema?
> Currently we have to write:
> 
>       - const: vendor,soc1-ip
> 
>       - items:
>           - enum:
>               - vendor,soc2-ip
>               - vendor,soc3-ip
>           - const: vendor,soc1-ip       # fallback
> 
> If dt-schema would automatically drop duplicates of the fallback,
> we could just write:
> 
>       - items:
>           - enum:
>               - vendor,soc1-ip
>               - vendor,soc2-ip
>               - vendor,soc3-ip
>           - const: vendor,soc1-ip       # fallback
> 
> What do you think?

It would almost work with just 'minItems: 1' added. That's because we 
require strings to be unique entries, so soc1 twice will be rejected. 
But then that allows for no fallback with soc2 and soc3.

So I don't see a way to do this other than transforming the above back 
into what we have today under a oneOf. That's a bit more deviation from 
json-schema than I'm comfortable with. Mostly the tools just add 
properties (like 'additionalItems: false' here) where the default is not 
what we want.

Rob

  parent reply	other threads:[~2025-10-09 20:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-05 14:44 [PATCH v2 0/4] dt-bindings: watchdog: factor out RZ watchdogs Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 1/4] dt-bindings: watchdog: factor out RZ/A watchdog Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 2/4] dt-bindings: watchdog: factor out RZ/N1 watchdog Wolfram Sang
2025-10-05 14:44 ` [PATCH v2 3/4] dt-bindings: watchdog: factor out RZ/G2L watchdog Wolfram Sang
2025-10-05 16:04   ` Biju Das
2025-10-05 14:44 ` [PATCH v2 4/4] dt-bindings: watchdog: factor out RZ/V2H(P) watchdog Wolfram Sang
2025-10-05 16:07   ` Biju Das
2025-10-05 16:11     ` Biju Das
2025-10-05 16:19     ` wsa+renesas
2025-10-06  3:17       ` Biju Das
2025-10-06  6:30         ` wsa+renesas
2025-10-06  9:25           ` Geert Uytterhoeven
2025-10-06  9:43             ` wsa+renesas
2025-10-06  9:54               ` Geert Uytterhoeven
2025-10-09 20:00             ` Rob Herring [this message]
2025-10-06  8:39   ` Wolfram Sang

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=20251009200054.GA3245555-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=geert@linux-m68k.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=magnus.damm@gmail.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=wim@linux-watchdog.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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;
as well as URLs for NNTP newsgroup(s).