Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15738133rwb; Mon, 28 Nov 2022 15:39:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf7S9GMm1JXWp17IwA0kyXdsrUglZoKZ5/WJmg5pasiJBDDuiE+PqcqSo3ZaPz25lEXfbo7k X-Received: by 2002:a05:6a00:1310:b0:561:a494:b299 with SMTP id j16-20020a056a00131000b00561a494b299mr33329837pfu.34.1669678761496; Mon, 28 Nov 2022 15:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669678761; cv=none; d=google.com; s=arc-20160816; b=Ol7VPSPruuQUDtOY36A8tf4D+3j91/phbXNRvWJSft5j8/d6EBRzXNBhkQDyhiwJQF 8fv7EuRD2T/npvoIKxowI5qwChW/RqzFnlNv5Ogp9xzXjU7DCeNF4gA42Hpli+IrDY1H P69bxNsw1iVOWvjpioP/aDfyoDaKwi9J7Q2rojq4AswUynMVYZU5Sal9LQoHngPRTgpg m3ApcrC1up8mfNBd/L5HTcXAdj+D10Ux3cWh86ZL/oMty/RLx7SUCY3j7GjDvQsUEAUj o2FPSpAvvI6+VikYxj3w87NkcvcXDpqRMFsn3VU2Vosq6fJUzPuSx4lDliijDAdX9bRB QKFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=q5dZdPYvUfozQhqkmlonGbI8EniXavdtqXfZRx36D18=; b=ZJYJAdecut53NORUERR+xmHkM3hYo+/KI2xD0fFLlmZroIOeeznV7VSwcVDXeFNOv5 DV53Ii88b00U+e75g2SgnTdU/xvkXJnWugKMMbhFJ2zcODoGNTx0ZzDXl9SKOfU1QR8G 8phiW6CfoUzNDe2sHxng0B1smWTXEX6XgCaggoZdirtm9yvT/spp8m0g2oo/FI5gHyqU 7P/dNmG9F6la3TSMc5hVLsqZ+gUfllqESZZ4AKz4mE+CISrp47L8GQaufpEgakq/ltZz ZGareMW+0Gn7v/pP6ckBP5YhOIMnYAiW5Cu40ats9GSOj4ISdPQlYczlFmGSSGsytAMi UZVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f9-20020a170902f38900b00188729593c0si11192372ple.47.2022.11.28.15.39.10; Mon, 28 Nov 2022 15:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234489AbiK1XXq (ORCPT + 83 others); Mon, 28 Nov 2022 18:23:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234570AbiK1XXm (ORCPT ); Mon, 28 Nov 2022 18:23:42 -0500 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3BEE31370; Mon, 28 Nov 2022 15:23:40 -0800 (PST) Received: by mail-oi1-f175.google.com with SMTP id l127so13387665oia.8; Mon, 28 Nov 2022 15:23:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=q5dZdPYvUfozQhqkmlonGbI8EniXavdtqXfZRx36D18=; b=2KUzR/rGh13yVKqBidaKmBq5efLqvZrqTa33r+JL0hZsPyszKtu1WRZpeHJ3L7jaFZ xedyCXP/fgAkPoQIXiskvOABEjU4lo3lfFcmS7YLIc02za3e5Pe1AxjBe/WqwAv+OpR9 HQlUrPKo9PUOVVm30SbncSs0/IsvUKU3CcByyiqeK15jlZvyAtayciK7gAgWeuVYSCQ/ /wY7iY5SwEtozI/nGsoCuezQFowxjEICw/bsr788qODWIaz2YlWOUZ0dtr/Jk2NiMegJ xr4NsQKj7B7YIa3d/tnhB+OmCOO/uFmvrXI4gfMTwY+hqlcQuwAGw87ABWUEDAhci+cX /UGg== X-Gm-Message-State: ANoB5pmwlp3m6EM3HwJD7DCit0g5KfDewDWD3PMEo3I7xnGt9ygbKTDQ mXcGf897XyXvzGt5I6OGXg== X-Received: by 2002:aca:c108:0:b0:354:946b:f72f with SMTP id r8-20020acac108000000b00354946bf72fmr19606267oif.48.1669677820060; Mon, 28 Nov 2022 15:23:40 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id m25-20020a056870059900b001422f9b5c17sm6565028oap.8.2022.11.28.15.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 15:23:39 -0800 (PST) Received: (nullmailer pid 1685201 invoked by uid 1000); Mon, 28 Nov 2022 23:23:37 -0000 Date: Mon, 28 Nov 2022 17:23:37 -0600 From: Rob Herring To: Colin Foster Cc: linux-renesas-soc@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, John Crispin , Alexandre Belloni , Claudiu Manoil , Marek Vasut , Sean Wang , DENG Qingfang , Landen Chao , =?UTF-8?B?bsOnIMOcTkFM?= , Vivien Didelot , =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , =?UTF-8?Q?Alvin_=C5=A0ipraga?= , Linus Walleij , UNGLinuxDriver@microchip.com, Woojung Huh , Matthias Brugger , Kurt Kanzenbach , Krzysztof Kozlowski , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Vladimir Oltean , Florian Fainelli , Andrew Lunn , George McCollister Subject: Re: [PATCH v3 net-next 03/10] dt-bindings: net: dsa: utilize base definitions for standard dsa switches Message-ID: <20221128232337.GA1513198-robh@kernel.org> References: <20221127224734.885526-1-colin.foster@in-advantage.com> <20221127224734.885526-4-colin.foster@in-advantage.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221127224734.885526-4-colin.foster@in-advantage.com> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 27, 2022 at 02:47:27PM -0800, Colin Foster wrote: > DSA switches can fall into one of two categories: switches where all ports > follow standard '(ethernet-)?port' properties, and switches that have > additional properties for the ports. > > The scenario where DSA ports are all standardized can be handled by > swtiches with a reference to 'dsa.yaml#'. > > The scenario where DSA ports require additional properties can reference > the new '$dsa.yaml#/$defs/base'. This will allow switches to reference > these base defitions of the DSA switch, but add additional properties under > the port nodes. You have this backwards. '$dsa.yaml#/$defs/base' can't be extended. Perhaps '$defs/ethernet-ports' would be a better name. > > Suggested-by: Rob Herring > Signed-off-by: Colin Foster > --- > > v3 > * New patch > > --- > .../bindings/net/dsa/arrow,xrs700x.yaml | 2 +- > .../devicetree/bindings/net/dsa/brcm,b53.yaml | 2 +- > .../devicetree/bindings/net/dsa/dsa.yaml | 19 ++++++++++++++++--- > .../net/dsa/hirschmann,hellcreek.yaml | 2 +- > .../bindings/net/dsa/mediatek,mt7530.yaml | 2 +- > .../bindings/net/dsa/microchip,ksz.yaml | 2 +- > .../bindings/net/dsa/microchip,lan937x.yaml | 2 +- > .../bindings/net/dsa/mscc,ocelot.yaml | 2 +- > .../bindings/net/dsa/nxp,sja1105.yaml | 2 +- > .../devicetree/bindings/net/dsa/realtek.yaml | 2 +- > .../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 2 +- > 11 files changed, 26 insertions(+), 13 deletions(-) > > diff --git a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml > index 259a0c6547f3..8d5abb05abdf 100644 > --- a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml > @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# > title: Arrow SpeedChips XRS7000 Series Switch Device Tree Bindings > > allOf: > - - $ref: dsa.yaml# > + - $ref: dsa.yaml#/$defs/base > > maintainers: > - George McCollister > diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml > index 1219b830b1a4..f323fc01b224 100644 > --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml > @@ -66,7 +66,7 @@ required: > - reg > > allOf: > - - $ref: dsa.yaml# > + - $ref: dsa.yaml#/$defs/base > - if: > properties: > compatible: > diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > index b9d48e357e77..bd1f0f7c14a8 100644 > --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > @@ -19,9 +19,6 @@ description: > select: false > > properties: > - $nodename: > - pattern: "^(ethernet-)?switch(@.*)?$" > - > dsa,member: > minItems: 2 > maxItems: 2 > @@ -58,4 +55,20 @@ oneOf: > > additionalProperties: true > > +$defs: > + base: > + description: A DSA switch without any extra port properties > + $ref: '#/' > + > + patternProperties: > + "^(ethernet-)?ports$": This node at the top level needs 'additionalProperties: false' assuming we don't allow extra properties in 'ports' nodes. If we do, then we'll need to be able to reference the 'ports' schema to extend it like is done with dsa-ports.yaml. > + type: object > + > + patternProperties: > + "^(ethernet-)?ports@[0-9]+$": > + description: Ethernet switch ports > + $ref: dsa-port.yaml# > + unevaluatedProperties: false > + > + One blank line. > ...