devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Subject: Re: [PATCH v2] dt-bindings: renesas: Document preferred compatible naming
Date: Tue, 13 Feb 2024 13:30:46 +0100	[thread overview]
Message-ID: <20240213123046.GF1870743@ragnatech.se> (raw)
In-Reply-To: <CAMuHMdXBYfi==T_EzbagJFVYkvYU=usEsru1T7Z=rBHFHt-CMg@mail.gmail.com>

Hi Geert,

On 2024-02-13 09:29:55 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> On Tue, Feb 13, 2024 at 12:38 AM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> > On 2024-02-12 20:36:12 +0100, Geert Uytterhoeven wrote:
> > > On Sat, Jan 27, 2024 at 1:20 PM Niklas Söderlund
> > > <niklas.soderlund+renesas@ragnatech.se> wrote:
> > > > Compatibles can come in two formats. Either "vendor,ip-soc" or
> > > > "vendor,soc-ip". Add a DT schema file documenting Renesas preferred
> > > > policy and enforcing it for all new compatibles, except few existing
> > > > patterns.
> > > >
> > > > Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > > > ---
> > > > * Changes since v1
> > > > - Split the "SoC agnostic compatibles" section into two to make it's
> > > >   intent clearer.
> > > > - Improved the documentation for each group of compatibles.
> > > > - Reduced the number of regexp to create a larger target area. As
> > > >   suggested by Krzysztof the goal is not to validate each SoC name but
> > > >   check for the correct order of SoC-IP.
> > >
> > > Thanks for the update!
> > >
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/soc/renesas/renesas-soc.yaml
> 
> > > > +properties:
> > > > +  compatible:
> > > > +    oneOf:
> > > > +      # Preferred naming style for compatibles of SoC components
> > > > +      - pattern: "^renesas,emev2-[a-z0-9-]+$"
> > > > +      - pattern: "^renesas,r(7s|8a|9a)[a-z0-9]+-[a-z0-9-]+$"
> > > > +      - pattern: "^renesas,rcar-[a-z0-9-]+$"
> > > > +      - pattern: "^renesas,rz[a-z0-9]*-[a-z0-9-]+$"
> > > > +      - pattern: "^renesas,sh-[a-z0-9-]+$"
> > > > +      - pattern: "^renesas,sh7[a-z0-9]+-[a-z0-9-]+$"
> > >
> > > I guess it's not worth adding rmobile and shmobile prefixes?
> >
> > Maybe we start with this and see how it goes?
> 
> Sure.
> 
> >
> > >
> > > > +      # Fixed legacy compatibles
> > > > +      #
> > > > +      # List cannot grow with new bindings.
> > > > +      - enum:
> > > > +          - renesas,bsc-r8a73a4
> > > > +          - renesas,bsc-sh73a0
> > > > +          - renesas,dbsc-r8a73a4
> > > > +          - renesas,dbsc3-r8a7740
> > > > +          - renesas,em-gio
> > > > +          - renesas,em-sti
> > > > +          - renesas,em-uart
> > >
> > > Perhaps combine these three: "renesas,em-(gpio|sti|usrt)"?
> >
> > Will do.
> 
> That does mean these lines need to use
> 
>   - pattern: "^renesas,em-(gpio|sti|uart)$"
> 
> right?

Yes, a pattern is needed. I will try to condense the lists as much as 
possible at the cost of strictness as this seems to be the common theme 
in reviewer. This will be,

    pattern: "^renesas,em-[a-z0-9]+$"

Or
    pattern: "^renesas,(em|foo|bar|baz)-[a-z0-9]+$"

> 
> > > Now, how do I trigger violations?
> > >
> > > I added the following to a binding file:
> > >
> > >           - enum:
> > >               - renesas,bogus-r8a7778
> > >               - renesas,bogus-r8a7779
> > >           - const: renesas,bogus
> > >
> > > but nothing happened with "make dt_binding_check".
> > >
> > > I added the following to a DTS file:
> > >
> > >         compatible = "renesas,bogus-r8a7778", "renesas,bogus";
> > >
> > > again, nothing happened with "make dtbs_check".
> > >
> > > What am I missing?
> >
> > Hum, this is odd. I have confirmed your finding that
> >
> >     compatible = "renesas,bogus-r8a7778", "renesas,bogus";
> >
> > or
> >
> >     compatible = "renesas,bogus-r8a7778", "renesas,bogus-bar";
> >
> > Do not trigger an issue, but a single compatible,
> >
> >     compatible = "renesas,bogus-r8a7778";
> >
> > Do trigger.
> >
> > I tested this before I reduced the regexp and IIRC it worked as expected
> > for the RFC. Not sure if I have updated dt-schema since, but I know I
> > rebased the branch for v2. I will try to figure out what have gone
> > wrong, if anyone know if something changed in this area pleas let me
> > know.
> 
> Thanks for confirming, and for looking into this!

I figured it out, the error is in the yaml file and I have a fix. Not 
sure why it ever worked in the RFC without it.

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

-- 
Kind Regards,
Niklas Söderlund

  reply	other threads:[~2024-02-13 12:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-27 12:19 [PATCH v2] dt-bindings: renesas: Document preferred compatible naming Niklas Söderlund
2024-02-05 16:45 ` Rob Herring
2024-02-10 13:06 ` Niklas Söderlund
2024-02-10 20:45   ` Conor Dooley
2024-02-12 19:36 ` Geert Uytterhoeven
2024-02-12 23:38   ` Niklas Söderlund
2024-02-13  8:29     ` Geert Uytterhoeven
2024-02-13 12:30       ` Niklas Söderlund [this message]
2024-02-13 12:40         ` Geert Uytterhoeven

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=20240213123046.GF1870743@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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).