lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAL_JsqJ7QAMRWQs4iuEmPpj2q2t0tCEGBNP+9QvTwZ=aeJn4vQ@mail.gmail.com>
Date:   Tue, 19 Oct 2021 11:15:24 -0500
From:   Rob Herring <robh@...nel.org>
To:     Ansuel Smith <ansuelsmth@...il.com>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Vivien Didelot <vivien.didelot@...il.com>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vladimir Oltean <olteanv@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Russell King <linux@...linux.org.uk>,
        John Crispin <john@...ozen.org>,
        netdev <netdev@...r.kernel.org>, devicetree@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        linux-arm-msm <linux-arm-msm@...r.kernel.org>,
        Matthew Hagan <mnhagan88@...il.com>
Subject: Re: [net-next PATCH v7 16/16] dt-bindings: net: dsa: qca8k: convert
 to YAML schema

On Mon, Oct 18, 2021 at 9:22 AM Ansuel Smith <ansuelsmth@...il.com> wrote:
>
> On Mon, Oct 18, 2021 at 09:15:12AM -0500, Rob Herring wrote:
> > On Thu, Oct 14, 2021 at 12:39:21AM +0200, Ansuel Smith wrote:
> > > From: Matthew Hagan <mnhagan88@...il.com>
> > >
> > > Convert the qca8k bindings to YAML format.
> > >
> > > Signed-off-by: Matthew Hagan <mnhagan88@...il.com>
> > > Co-developed-by: Ansuel Smith <ansuelsmth@...il.com>
> > > Signed-off-by: Ansuel Smith <ansuelsmth@...il.com>
> > > ---
> > >  .../devicetree/bindings/net/dsa/qca8k.txt     | 245 ------------
> > >  .../devicetree/bindings/net/dsa/qca8k.yaml    | 362 ++++++++++++++++++
> > >  2 files changed, 362 insertions(+), 245 deletions(-)
> > >  delete mode 100644 Documentation/devicetree/bindings/net/dsa/qca8k.txt
> > >  create mode 100644 Documentation/devicetree/bindings/net/dsa/qca8k.yaml

> > > +patternProperties:
> > > +  "^(ethernet-)?ports$":
> > > +    type: object
> > > +    properties:
> > > +      '#address-cells':
> > > +        const: 1
> > > +      '#size-cells':
> > > +        const: 0
> > > +
> > > +    patternProperties:
> > > +      "^(ethernet-)?port@[0-6]$":
> > > +        type: object
> > > +        description: Ethernet switch ports
> > > +
> > > +        properties:
> > > +          reg:
> > > +            description: Port number
> > > +
> > > +          label:
> > > +            description:
> > > +              Describes the label associated with this port, which will become
> > > +              the netdev name
> > > +            $ref: /schemas/types.yaml#/definitions/string
> > > +
> > > +          link:
> > > +            description:
> > > +              Should be a list of phandles to other switch's DSA port. This
> > > +              port is used as the outgoing port towards the phandle ports. The
> > > +              full routing information must be given, not just the one hop
> > > +              routes to neighbouring switches
> > > +            $ref: /schemas/types.yaml#/definitions/phandle-array
> > > +
> > > +          ethernet:
> > > +            description:
> > > +              Should be a phandle to a valid Ethernet device node.  This host
> > > +              device is what the switch port is connected to
> > > +            $ref: /schemas/types.yaml#/definitions/phandle
> >
> > All of this is defined in dsa.yaml. Add a $ref to it and don't duplicate
> > it here.
> >
>
> The reason I redefined it is because I didn't manage to find a way on
> how to add additional bindings for the qca,sgmii... . Any hint about
> that?

The problem is we can't have a single schema for parent and child
nodes and then allow additional properties in a child node at least if
we want to make sure all child properties are defined.

The port part of dsa.yaml needs to be split out either to a separate
file or under '$defs' in the same file so that you can reference it
and add properties.

As a separate file, you can then do:

"^(ethernet-)?port@[0-9]+$":
  $ref: dsa-port.yaml#
  unevaluatedProperties: false
  properties:
    a-custom-prop: ...

>
> I tried with allOf but the make check still printed errors in the
> example with not valid binding about qca,sgmii.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ