public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Rob Herring <robh+dt@kernel.org>
Cc: netdev <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>, "Andrew Lunn" <andrew@lunn.ch>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Oleksij Rempel" <linux@rempel-privat.de>,
	"Christian Marangi" <ansuelsmth@gmail.com>,
	"John Crispin" <john@phrozen.org>,
	"Kurt Kanzenbach" <kurt@linutronix.de>,
	"Mans Rullgard" <mans@mansr.com>,
	"Arun Ramadoss" <arun.ramadoss@microchip.com>,
	"Woojung Huh" <woojung.huh@microchip.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"Claudiu Manoil" <claudiu.manoil@nxp.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"George McCollister" <george.mccollister@gmail.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Hauke Mehrtens" <hauke@hauke-m.de>,
	"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
	"Aleksander Jan Bajkowski" <olek2@wp.pl>,
	"Alvin Šipraga" <alsi@bang-olufsen.dk>,
	"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Pawel Dembicki" <paweldembicki@gmail.com>,
	"Clément Léger" <clement.leger@bootlin.com>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Russell King" <rmk+kernel@armlinux.org.uk>,
	"Marek Behún" <kabel@kernel.org>,
	"Marcin Wojtas" <mw@semihalf.com>,
	"Frank Rowand" <frowand.list@gmail.com>
Subject: Re: [PATCH v2 net-next 4/4] net: dsa: validate that DT nodes of shared ports have the properties they need
Date: Mon, 1 Aug 2022 14:11:25 +0000	[thread overview]
Message-ID: <20220801141124.2bhkzqtp36hdkq5u@skbuf> (raw)
In-Reply-To: <CAL_JsqLyCJE2c4ORx-kK1iUMR08iMUMDi0FMb9WeTyfyzO3GKw@mail.gmail.com>

On Mon, Aug 01, 2022 at 08:02:56AM -0600, Rob Herring wrote:
> > +if:
> > +  oneOf:
> > +    - properties:
> > +        ethernet:
> > +          items:
> > +            $ref: /schemas/types.yaml#/definitions/phandle
> > +    - properties:
> > +        link:
> > +          items:
> > +            $ref: /schemas/types.yaml#/definitions/phandle-array
> 
> 'items' here is wrong. 'required' is needed because the property not
> present will be true otherwise.
> 
> Checking the type is redundant given the top-level schema already does that.

Excuse me, but I don't understand. I verified this and it works as
expected - if the property is present, the 'items' evaluates to true,
otherwise to false.

Could you suggest an alternative way of checking whether the 'ethernet'
or 'link' properties are present, as part of a conditional?

> > I have deliberately made this part of dsa-port.yaml and not depend on
> > any compatible string. The reason is the code - we'll warn about missing
> > properties regardless of whether we have fallback logic for some older
> > switches. Essentially the fact that some switches have the fallback to
> > not use phylink will remain an undocumented easter egg as far as the
> > dt-schema is concerned.
> 
> dsa-port.yaml is only applied when some other schema references it
> which is probably based on some compatible. If you want to apply this
> under some other condition, then you need a custom 'select' schema to
> define when.

No, this is good, I think. I got a "build warning" from your bot which
found the DSA examples which had missing required properties, so I think
it works the way I indended it.

  reply	other threads:[~2022-08-01 14:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 13:21 [PATCH v2 net-next 0/4] Validate OF nodes for DSA shared ports Vladimir Oltean
2022-07-29 13:21 ` [PATCH v2 net-next 1/4] of: base: export of_device_compatible_match() for use in modules Vladimir Oltean
2022-07-29 13:21 ` [PATCH v2 net-next 2/4] net: dsa: avoid dsa_port_link_{,un}register_of() calls with platform data Vladimir Oltean
2022-07-29 13:21 ` [PATCH v2 net-next 3/4] net: dsa: rename dsa_port_link_{,un}register_of Vladimir Oltean
2022-07-29 13:21 ` [PATCH v2 net-next 4/4] net: dsa: validate that DT nodes of shared ports have the properties they need Vladimir Oltean
2022-07-29 16:22   ` Rob Herring
2022-07-29 17:01     ` Vladimir Oltean
2022-07-29 18:39       ` Rob Herring
2022-07-30 16:23         ` Vladimir Oltean
2022-08-01 14:02           ` Rob Herring
2022-08-01 14:11             ` Vladimir Oltean [this message]
2022-08-01 14:26               ` Rob Herring
2022-07-29 17:57   ` Marcin Wojtas
2022-07-29 18:34     ` Vladimir Oltean
2022-07-29 20:36       ` Marcin Wojtas
2022-07-29 21:17         ` Andrew Lunn
2022-07-29 21:24           ` Florian Fainelli
2022-07-29 21:33             ` Marcin Wojtas
2022-07-29 21:44               ` Florian Fainelli
2022-07-30  0:49               ` Vladimir Oltean

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=20220801141124.2bhkzqtp36hdkq5u@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=Landen.Chao@mediatek.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alsi@bang-olufsen.dk \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=arun.ramadoss@microchip.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=clement.leger@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=george.mccollister@gmail.com \
    --cc=hauke@hauke-m.de \
    --cc=john@phrozen.org \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kurt@linutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux@rempel-privat.de \
    --cc=luizluca@gmail.com \
    --cc=mans@mansr.com \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mw@semihalf.com \
    --cc=netdev@vger.kernel.org \
    --cc=olek2@wp.pl \
    --cc=pabeni@redhat.com \
    --cc=paweldembicki@gmail.com \
    --cc=rmk+kernel@armlinux.org.uk \
    --cc=robh+dt@kernel.org \
    --cc=sean.wang@mediatek.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.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