Message ID | 20231018-marvell-88e6152-wan-led-v4-1-3ee0c67383be@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4655595vqb; Wed, 18 Oct 2023 02:04:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJYnMWG+lEDdgSjrsy8AqOKOkHH72sABdkckoRj1RnSD8wgopTYs5OekokIDWVSF5ykLtW X-Received: by 2002:a17:903:334c:b0:1c7:5581:f9c with SMTP id ka12-20020a170903334c00b001c755810f9cmr4676910plb.0.1697619872667; Wed, 18 Oct 2023 02:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697619872; cv=none; d=google.com; s=arc-20160816; b=ey62ybOP3JxVH25iavoSHrMkmhbZynRH7LRM8pFRqyroG5TlMFbYJKx29eKdyNlb51 1D0aE+5kNRCL7YWI5iG52O0bf/V2qLuHMaqnhHe2JvEGYUhBZ8j4hTPoc7SFSKpkxQTs jNi6cOlnQO3+XOsYm3ZLu2XKxhzsfUMSyN0EZTb5Q+Za3CCCBEHIx29dK84WBcspDSag xXuHcJYtxpbjqFWmFmhC/C2lndvakgbeRhLasDIfWucarXyYLMoYtw0CBb85Aa5VW6d5 FwRGGAkCH5VUzMKdeE6OpFrt7cS7DzmrwZzslmvAsVmbYq/8GJOybTumIGM3YJUeSor9 1G0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=2tyOup0+oFY1qNiEuX6Mw7ppmGYAINv0IB1dZ7z8mjE=; fh=aTFnFe9atwfOYas2jpUC764SgvternTIWFn22IOx8z0=; b=oI4F3AcTL6Ep9wL/3VcuuFPczdT3f6oebiVEK2ALXjOdgMlL5QodK5Lta/egT8vBRi J3Y/MEaQRufKVX+AUEqCvSVi2wNzI1dmvWyDS9poaU1HFQ2XRgCHrsOfqezq5pD369tF vkeRi1z+gAp2JD0CvMbBIHan7WPo53YW1in6UkCI0T2g0+hWIUWcTCJZOpEammbVI/tu surpzBjPwRu6/kpishZJYsvrEkpQnt6mcDGOHKlSvXxqdb3I+OSxKfjg6qSvbPDuxAIF a6msRsuHmZ+bNsy0iLAizjjnftrSBuJYNO6O+DCdCvf32reA+DOYaHZ9ByW1gpNPVcxS rz6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qJ1wYng2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id b11-20020a170902bd4b00b001c9de56a7d4si3556313plx.398.2023.10.18.02.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 02:04:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qJ1wYng2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id E3A808031D4D; Wed, 18 Oct 2023 02:04:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229576AbjJRJD6 (ORCPT <rfc822;lkml4gm@gmail.com> + 24 others); Wed, 18 Oct 2023 05:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229619AbjJRJDz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Oct 2023 05:03:55 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3AC05F7 for <linux-kernel@vger.kernel.org>; Wed, 18 Oct 2023 02:03:53 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-507c78d258fso826764e87.2 for <linux-kernel@vger.kernel.org>; Wed, 18 Oct 2023 02:03:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1697619831; x=1698224631; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2tyOup0+oFY1qNiEuX6Mw7ppmGYAINv0IB1dZ7z8mjE=; b=qJ1wYng2P/ZY4bg8Bl2Yx5rMa0McXZe1kIvz6BSt706kQFSt2ugMthu+brJHImmlnu S1RlFuULhpnTdGoMxZu9JYBvJitNRYG07BXnz5CSRhzRO7COYkkYp0dix/gIYNyNcC9i Ha9RX/7UDk1Uk2qbWr27Xw+gBacCefSQeddwEdJ8ztuf0MZV4BL6UEg133XmV73tc/sd zPF02RJEGNiEQYKzFPKDr7bZj0c10em8c8CidnG1VOUEzQr5iV+Evq8R+LT6i+UxMO4C 3UzvsbXYT7g7QeBhR+fnsQf0rRwiZlhdocmamphwDoGjZEtjwlpoTkaSuA+yOE+hnO8f PdNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697619831; x=1698224631; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2tyOup0+oFY1qNiEuX6Mw7ppmGYAINv0IB1dZ7z8mjE=; b=rEF5s4vC6tCEE2Atma1KnS+pZa6690TBoYPDBhlJX3WCBXCVJiVl0D2EVgyruZbhEl xXvpE7JBvm9c8Pk+JAWftYRQhuqXKel8YJYS3VOzn/iudIInKEcne4h9YUvM/ePi99yl gbhkjlb6iUzROCuELEqUW3QWOXmajkSSkjxJLf142MDVQhMda8hsIK1IokIVJD21jqza 6k4nl6fSW0Ndi8p/bofPg0ZlHxe9tJ17j0rCkZxtRQOGBRTiOsV/8TPNE32t3w9hasMf lspZtaHJnDO8gRL0O6+aYBlGAYTrCbMa/gMh1Y16JpEcGv+LQggjtLsw9RJ+S2qyxLWy d1Yg== X-Gm-Message-State: AOJu0YyOYubnJMGNL5HoBVNjaeEF1gc7HQss297gC4MFgxqc7OFF3LVM Z67Co6ocbF/zJCYX5n3Q7eI6Kg== X-Received: by 2002:ac2:484c:0:b0:4ff:a8c6:d1aa with SMTP id 12-20020ac2484c000000b004ffa8c6d1aamr3328690lfy.48.1697619831405; Wed, 18 Oct 2023 02:03:51 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id w19-20020a05651234d300b005056fb1d6fbsm616595lfr.238.2023.10.18.02.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 02:03:50 -0700 (PDT) From: Linus Walleij <linus.walleij@linaro.org> Date: Wed, 18 Oct 2023 11:03:40 +0200 Subject: [PATCH net-next v4 1/7] dt-bindings: net: dsa: Require ports or ethernet-ports MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231018-marvell-88e6152-wan-led-v4-1-3ee0c67383be@linaro.org> References: <20231018-marvell-88e6152-wan-led-v4-0-3ee0c67383be@linaro.org> In-Reply-To: <20231018-marvell-88e6152-wan-led-v4-0-3ee0c67383be@linaro.org> To: Andrew Lunn <andrew@lunn.ch>, Gregory Clement <gregory.clement@bootlin.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Russell King <linux@armlinux.org.uk>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: Christian Marangi <ansuelsmth@gmail.com>, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>, Rob Herring <robh@kernel.org> X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 02:04:26 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780083455270837434 X-GMAIL-MSGID: 1780083455270837434 |
Series |
Create a binding for the Marvell MV88E6xxx DSA switches
|
|
Commit Message
Linus Walleij
Oct. 18, 2023, 9:03 a.m. UTC
Bindings using dsa.yaml#/$defs/ethernet-ports specify that
a DSA switch node need to have a ports or ethernet-ports
subnode, and that is actually required, so add requirements
using oneOf.
Suggested-by: Rob Herring <robh@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++
1 file changed, 6 insertions(+)
Comments
On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > a DSA switch node need to have a ports or ethernet-ports > subnode, and that is actually required, so add requirements > using oneOf. > > Suggested-by: Rob Herring <robh@kernel.org> > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > --- > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13): yamllint warnings/errors: ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) dtschema/dtc warnings/errors: Traceback (most recent call last): File "/usr/local/bin/dt-doc-validate", line 64, in <module> ret |= check_doc(f) ^^^^^^^^^^^^ File "/usr/local/bin/dt-doc-validate", line 32, in check_doc for error in sorted(dtsch.iter_errors(), key=lambda e: e.linecol): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 125, in iter_errors self.annotate_error(scherr, meta_schema, scherr.schema_path) File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 104, in annotate_error schema = schema[p] ~~~~~~^^^ KeyError: 'type' doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20231018-marvell-88e6152-wan-led-v4-1-3ee0c67383be@linaro.org The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.
On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > a DSA switch node need to have a ports or ethernet-ports > > subnode, and that is actually required, so add requirements > > using oneOf. > > > > Suggested-by: Rob Herring <robh@kernel.org> > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > --- > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > yamllint warnings/errors: > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) Really? + oneOf: + - required: + - ports + - required: + - ethernet-ports Two spaces after the oneOf, 2 spaces after a required as usual. I don't get it. Yours, Linus Walleij
On Wed, Oct 18, 2023 at 01:11:45PM +0200, Linus Walleij wrote: > On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > a DSA switch node need to have a ports or ethernet-ports > > > subnode, and that is actually required, so add requirements > > > using oneOf. > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > > --- > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > yamllint warnings/errors: > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > Really? > > + oneOf: > + - required: > + - ports > + - required: > + - ethernet-ports > > Two spaces after the oneOf, 2 spaces after a required as usual. > I don't get it. Given the other python errors spat out in Rob's report, I would suggest that the "bot" is running a development version that hasn't been fully tested, so anything it spits out is suspect. Maybe Rob can comment on the validity of the warnings in the report.
On Thu, Oct 19, 2023 at 11:58:49AM +0100, Russell King (Oracle) wrote: > On Wed, Oct 18, 2023 at 01:11:45PM +0200, Linus Walleij wrote: > > On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: > > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > > a DSA switch node need to have a ports or ethernet-ports > > > > subnode, and that is actually required, so add requirements > > > > using oneOf. > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > > > --- > > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > > > yamllint warnings/errors: > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > Really? > > > > + oneOf: > > + - required: > > + - ports > > + - required: > > + - ethernet-ports > > > > Two spaces after the oneOf, 2 spaces after a required as usual. > > I don't get it. > > Given the other python errors spat out in Rob's report, I would suggest > that the "bot" is running a development version that hasn't been fully > tested, so anything it spits out is suspect. Maybe Rob can comment on > the validity of the warnings in the report. In this case, I think it is correct. 2 spaces for the oneOf, 2 spaces the start of the required for the nested list, so: oneOf: - required: - ports - required: - ethernet-ports
On Wed, Oct 18, 2023 at 05:32:48AM -0500, Rob Herring wrote: > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > a DSA switch node need to have a ports or ethernet-ports > > subnode, and that is actually required, so add requirements > > using oneOf. > > > > Suggested-by: Rob Herring <robh@kernel.org> > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > --- > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > yamllint warnings/errors: > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > dtschema/dtc warnings/errors: > Traceback (most recent call last): > File "/usr/local/bin/dt-doc-validate", line 64, in <module> > ret |= check_doc(f) > ^^^^^^^^^^^^ > File "/usr/local/bin/dt-doc-validate", line 32, in check_doc > for error in sorted(dtsch.iter_errors(), key=lambda e: e.linecol): > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 125, in iter_errors > self.annotate_error(scherr, meta_schema, scherr.schema_path) > File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 104, in annotate_error > schema = schema[p] > ~~~~~~^^^ > KeyError: 'type' Locally, on an older version of dt-schema, I see /stuff/linux-dt/Documentation/devicetree/bindings/net/dsa/dsa.yaml: $defs: 'oneOf' should not be valid under {'$ref': '#/definitions/json-schema-prop-names'} hint: A json-schema keyword was found in $defs key. from schema $id: http://devicetree.org/meta-schemas/core.yaml# /stuff/linux-dt/Documentation/devicetree/bindings/net/dsa/dsa.yaml: $defs:oneOf: [{'required': ['ports']}, {'required': ['ethernet-ports']}] is not of type 'object' hint: $defs entries must contain schemas from schema $id: http://devicetree.org/meta-schemas/core.yaml# SCHEMA Documentation/devicetree/bindings/processed-schema.json On the latest version I see the error from the bot. Doing diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml index bd6948e4fd9e..25e5950d51ae 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -55,10 +55,10 @@ $defs: $ref: dsa-port.yaml# unevaluatedProperties: false - oneOf: - - required: - - ports - - required: - - ethernet-ports +oneOf: + - required: + - ports + - required: + - ethernet-ports ... resolves both issues, but the older version of dt-schema definitely had better error reporting in this case!
On Thu, Oct 19, 2023 at 12:58:46PM +0100, Conor Dooley wrote: > On Thu, Oct 19, 2023 at 11:58:49AM +0100, Russell King (Oracle) wrote: > > On Wed, Oct 18, 2023 at 01:11:45PM +0200, Linus Walleij wrote: > > > On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: > > > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > > > > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > > > a DSA switch node need to have a ports or ethernet-ports > > > > > subnode, and that is actually required, so add requirements > > > > > using oneOf. > > > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > > > > --- > > > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > > > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > > > > > yamllint warnings/errors: > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > > > Really? > > > > > > + oneOf: > > > + - required: > > > + - ports > > > + - required: > > > + - ethernet-ports > > > > > > Two spaces after the oneOf, 2 spaces after a required as usual. > > > I don't get it. > > > > Given the other python errors spat out in Rob's report, I would suggest > > that the "bot" is running a development version that hasn't been fully > > tested, so anything it spits out is suspect. Maybe Rob can comment on > > the validity of the warnings in the report. > > In this case, I think it is correct. > 2 spaces for the oneOf, 2 spaces the start of the required for the > nested list, so: > oneOf: > - required: This is a total of two spaces indentation. > - ports This is a total of six spaces indentation. You mention 2 spaces for the oneOf, which explains why the "- required" needs to be indented by two spaces. You also say 2 spaces for the required nested list, but what about the other two spaces? I guess if you're a YAML expert, this all makes sense, but to those of us who aren't, these quirky "features" of it just seem totally illogical.
On Thu, Oct 19, 2023 at 01:03:41PM +0100, Conor Dooley wrote: > On Wed, Oct 18, 2023 at 05:32:48AM -0500, Rob Herring wrote: > > > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > a DSA switch node need to have a ports or ethernet-ports > > > subnode, and that is actually required, so add requirements > > > using oneOf. > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > > --- > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > 1 file changed, 6 insertions(+) > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > yamllint warnings/errors: > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > dtschema/dtc warnings/errors: > > Traceback (most recent call last): > > File "/usr/local/bin/dt-doc-validate", line 64, in <module> > > ret |= check_doc(f) > > ^^^^^^^^^^^^ > > File "/usr/local/bin/dt-doc-validate", line 32, in check_doc > > for error in sorted(dtsch.iter_errors(), key=lambda e: e.linecol): > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 125, in iter_errors > > self.annotate_error(scherr, meta_schema, scherr.schema_path) > > File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 104, in annotate_error > > schema = schema[p] > > ~~~~~~^^^ > > KeyError: 'type' > > Locally, on an older version of dt-schema, I see > /stuff/linux-dt/Documentation/devicetree/bindings/net/dsa/dsa.yaml: $defs: 'oneOf' should not be valid under {'$ref': '#/definitions/json-schema-prop-names'} > hint: A json-schema keyword was found in $defs key. > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > /stuff/linux-dt/Documentation/devicetree/bindings/net/dsa/dsa.yaml: $defs:oneOf: [{'required': ['ports']}, {'required': ['ethernet-ports']}] is not of type 'object' > hint: $defs entries must contain schemas > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > SCHEMA Documentation/devicetree/bindings/processed-schema.json > > On the latest version I see the error from the bot. > > Doing > diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > index bd6948e4fd9e..25e5950d51ae 100644 > --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > @@ -55,10 +55,10 @@ $defs: > $ref: dsa-port.yaml# > unevaluatedProperties: false > > - oneOf: > - - required: > - - ports > - - required: > - - ethernet-ports > +oneOf: > + - required: > + - ports > + - required: > + - ethernet-ports > > ... > > resolves both issues, but the older version of dt-schema definitely had > better error reporting in this case! And now I'm even more confused... your example in your other reply had six spaces before "- ports" and "- ethernet-ports" but here you're using four spaces.
On Thu, Oct 19, 2023 at 01:28:27PM +0100, Russell King (Oracle) wrote: > On Thu, Oct 19, 2023 at 01:03:41PM +0100, Conor Dooley wrote: > > On Wed, Oct 18, 2023 at 05:32:48AM -0500, Rob Herring wrote: > > > > > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > > a DSA switch node need to have a ports or ethernet-ports > > > > subnode, and that is actually required, so add requirements > > > > using oneOf. > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > > > --- > > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > > > yamllint warnings/errors: > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > > > dtschema/dtc warnings/errors: > > > Traceback (most recent call last): > > > File "/usr/local/bin/dt-doc-validate", line 64, in <module> > > > ret |= check_doc(f) > > > ^^^^^^^^^^^^ > > > File "/usr/local/bin/dt-doc-validate", line 32, in check_doc > > > for error in sorted(dtsch.iter_errors(), key=lambda e: e.linecol): > > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 125, in iter_errors > > > self.annotate_error(scherr, meta_schema, scherr.schema_path) > > > File "/usr/local/lib/python3.11/dist-packages/dtschema/schema.py", line 104, in annotate_error > > > schema = schema[p] > > > ~~~~~~^^^ > > > KeyError: 'type' > > > > Locally, on an older version of dt-schema, I see > > /stuff/linux-dt/Documentation/devicetree/bindings/net/dsa/dsa.yaml: $defs: 'oneOf' should not be valid under {'$ref': '#/definitions/json-schema-prop-names'} > > hint: A json-schema keyword was found in $defs key. > > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > > /stuff/linux-dt/Documentation/devicetree/bindings/net/dsa/dsa.yaml: $defs:oneOf: [{'required': ['ports']}, {'required': ['ethernet-ports']}] is not of type 'object' > > hint: $defs entries must contain schemas > > from schema $id: http://devicetree.org/meta-schemas/core.yaml# > > SCHEMA Documentation/devicetree/bindings/processed-schema.json > > > > On the latest version I see the error from the bot. > > > > Doing > > diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > > index bd6948e4fd9e..25e5950d51ae 100644 > > --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml > > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > > @@ -55,10 +55,10 @@ $defs: > > $ref: dsa-port.yaml# > > unevaluatedProperties: false > > > > - oneOf: > > - - required: > > - - ports > > - - required: > > - - ethernet-ports > > +oneOf: > > + - required: > > + - ports > > + - required: > > + - ethernet-ports > > > > ... > > > > resolves both issues, but the older version of dt-schema definitely had > > better error reporting in this case! > > And now I'm even more confused... your example in your other reply had > six spaces before "- ports" and "- ethernet-ports" but here you're > using four spaces. Sorry! I thought it would be less confusing to provide a diff that resolved one issue only.
On Thu, Oct 19, 2023 at 01:27:09PM +0100, Russell King (Oracle) wrote: > On Thu, Oct 19, 2023 at 12:58:46PM +0100, Conor Dooley wrote: > > On Thu, Oct 19, 2023 at 11:58:49AM +0100, Russell King (Oracle) wrote: > > > On Wed, Oct 18, 2023 at 01:11:45PM +0200, Linus Walleij wrote: > > > > On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: > > > > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > > > > > > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > > > > a DSA switch node need to have a ports or ethernet-ports > > > > > > subnode, and that is actually required, so add requirements > > > > > > using oneOf. > > > > > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > > > > > --- > > > > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > > > > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > > > > > > > yamllint warnings/errors: > > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > > > > > Really? > > > > > > > > + oneOf: > > > > + - required: > > > > + - ports > > > > + - required: > > > > + - ethernet-ports > > > > > > > > Two spaces after the oneOf, 2 spaces after a required as usual. > > > > I don't get it. > > > > > > Given the other python errors spat out in Rob's report, I would suggest > > > that the "bot" is running a development version that hasn't been fully > > > tested, so anything it spits out is suspect. Maybe Rob can comment on > > > the validity of the warnings in the report. > > > > In this case, I think it is correct. > > 2 spaces for the oneOf, 2 spaces the start of the required for the > > nested list, so: > > oneOf: > > - required: > > This is a total of two spaces indentation. > > > - ports > > This is a total of six spaces indentation. > > You mention 2 spaces for the oneOf, which explains why the "- required" > needs to be indented by two spaces. You also say 2 spaces for the > required nested list, but what about the other two spaces? I a word that might've made it more clear. It is 2 spaces for the oneOf and 2 spaces _from_ the start of the required for the nested list. In theory you might have a contrived example that looks like: oneOf: - required: - ports properties: ethernet-ports: false - required: - ethernet-ports properties: ports: false Maybe with that example you can see that each option of the oneOf contains a `required` and a `properties` component at 4 spaces of indent, and then in turn the required properties, being sub-components of `required` grow 2 more spaces for 6. > I guess if you're a YAML expert, this all makes sense, but to those of > us who aren't, these quirky "features" of it just seem totally > illogical. If I were a yaml expert, I would probably be able to use the correct terminology to explain this better, but hopefully the example is useful.
On Thu, Oct 19, 2023 at 01:46:36PM +0100, Conor Dooley wrote: > On Thu, Oct 19, 2023 at 01:27:09PM +0100, Russell King (Oracle) wrote: > > On Thu, Oct 19, 2023 at 12:58:46PM +0100, Conor Dooley wrote: > > > On Thu, Oct 19, 2023 at 11:58:49AM +0100, Russell King (Oracle) wrote: > > > > On Wed, Oct 18, 2023 at 01:11:45PM +0200, Linus Walleij wrote: > > > > > On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: > > > > > > On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > > > > > > > > > > > Bindings using dsa.yaml#/$defs/ethernet-ports specify that > > > > > > > a DSA switch node need to have a ports or ethernet-ports > > > > > > > subnode, and that is actually required, so add requirements > > > > > > > using oneOf. > > > > > > > > > > > > > > Suggested-by: Rob Herring <robh@kernel.org> > > > > > > > Signed-off-by: Linus Walleij <linus.walleij@linaro.org> > > > > > > > --- > > > > > > > Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ > > > > > > > 1 file changed, 6 insertions(+) > > > > > > > > > > > > > > > > > > > My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' > > > > > > on your patch (DT_CHECKER_FLAGS is new in v5.13): > > > > > > > > > > > > yamllint warnings/errors: > > > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > > > ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > > > > > > > Really? > > > > > > > > > > + oneOf: > > > > > + - required: > > > > > + - ports > > > > > + - required: > > > > > + - ethernet-ports > > > > > > > > > > Two spaces after the oneOf, 2 spaces after a required as usual. > > > > > I don't get it. Either way is valid. It's just 2 different common styles and I picked the other way. The reason is to look different for a sequence vs. mapping: - required: - ethernet-ports - required: ethernet-ports It's easy to miss the missing '-'. > > > > Given the other python errors spat out in Rob's report, I would suggest > > > > that the "bot" is running a development version that hasn't been fully > > > > tested, so anything it spits out is suspect. Maybe Rob can comment on > > > > the validity of the warnings in the report. > > > > > > In this case, I think it is correct. > > > 2 spaces for the oneOf, 2 spaces the start of the required for the > > > nested list, so: > > > oneOf: > > > - required: > > > > This is a total of two spaces indentation. > > > > > - ports > > > > This is a total of six spaces indentation. > > > > You mention 2 spaces for the oneOf, which explains why the "- required" > > needs to be indented by two spaces. You also say 2 spaces for the > > required nested list, but what about the other two spaces? > > I a word that might've made it more clear. > It is 2 spaces for the oneOf and 2 spaces _from_ the start of the > required for the nested list. Yes, 'oneOf' here is not a json-schema keyword, but a key under $defs because it is indented. '$defs' entries must be a schema/dict/mapping (json-schema/python/yaml terms). > > In theory you might have a contrived example that looks like: > > oneOf: > - required: > - ports > properties: > ethernet-ports: false > > - required: > - ethernet-ports > properties: > ports: false > > Maybe with that example you can see that each option of the oneOf > contains a `required` and a `properties` component at 4 spaces of > indent, and then in turn the required properties, being sub-components > of `required` grow 2 more spaces for 6. > > > I guess if you're a YAML expert, this all makes sense, but to those of > > us who aren't, these quirky "features" of it just seem totally > > illogical. Indentation being significant is not quirky. Languages choose either indentation or brackets of some form. YAML uses one and JSON uses the other. > If I were a yaml expert, I would probably be able to use the correct > terminology to explain this better, but hopefully the example is useful. It has little to do with YAML other than indentation is *very* significant in YAML. It's actually valid YAML. It's probably valid json-schema, but questionable use in terms of how $defs is typically used. Anyways, I'm working on a fix for the meta-schema. Rob
On 18/10/2023 13:11, Linus Walleij wrote: > On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: >> On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > >>> Bindings using dsa.yaml#/$defs/ethernet-ports specify that >>> a DSA switch node need to have a ports or ethernet-ports >>> subnode, and that is actually required, so add requirements >>> using oneOf. >>> >>> Suggested-by: Rob Herring <robh@kernel.org> >>> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> >>> --- >>> Documentation/devicetree/bindings/net/dsa/dsa.yaml | 6 ++++++ >>> 1 file changed, 6 insertions(+) >>> >> >> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' >> on your patch (DT_CHECKER_FLAGS is new in v5.13): >> >> yamllint warnings/errors: >> ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) >> ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > Really? > > + oneOf: > + - required: > + - ports .........^ here > + - required: > + - ethernet-ports > > Two spaces after the oneOf, 2 spaces after a required as usual. > I don't get it. Although YAML accepts your indentation, yamllint does not and we always, always, expected yamllint flavor of syntax. Best regards, Krzysztof
On Fri, Oct 20, 2023 at 1:10 PM Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 18/10/2023 13:11, Linus Walleij wrote: > > On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: > >> On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > >> yamllint warnings/errors: > >> ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > >> ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) > > > > Really? > > > > + oneOf: > > + - required: > > + - ports > > .........^ here > > > + - required: > > + - ethernet-ports > > > > Two spaces after the oneOf, 2 spaces after a required as usual. > > I don't get it. > > Although YAML accepts your indentation, yamllint does not and we always, > always, expected yamllint flavor of syntax. That's chill, however I can't reproduce this, make dt_bindings_check in the mainline kernel does not yield this warning (after pip install --upgrade --user dtschema and yamllint is installed and all), so right now my only way of testing this patch is to mail it to the mailing list and have it tested by Rob's bot. I just don't understand what I'm supposed to do... drop the dash-space "- " in front of "- ports"? Then the bot will be happy? (This patch was added in response to Rob's comments "this should probably be in dsa.yaml".) We can also just drop the patch if this whole thing upsets the tooling, it's just intended as a generalization of this requirement as can be seen in Documentation/devicetree/bindings/net/dsa/qca8k.yaml which in turn can do that because it is not using the generic def. Yours, Linus Walleij
On 20/10/2023 13:41, Linus Walleij wrote: > On Fri, Oct 20, 2023 at 1:10 PM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: >> On 18/10/2023 13:11, Linus Walleij wrote: >>> On Wed, Oct 18, 2023 at 12:32 PM Rob Herring <robh@kernel.org> wrote: >>>> On Wed, 18 Oct 2023 11:03:40 +0200, Linus Walleij wrote: > > >>>> yamllint warnings/errors: >>>> ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:60:7: [warning] wrong indentation: expected 8 but found 6 (indentation) >>>> ./Documentation/devicetree/bindings/net/dsa/dsa.yaml:62:7: [warning] wrong indentation: expected 8 but found 6 (indentation) >>> >>> Really? >>> >>> + oneOf: >>> + - required: >>> + - ports >> >> .........^ here >> >>> + - required: >>> + - ethernet-ports >>> >>> Two spaces after the oneOf, 2 spaces after a required as usual. >>> I don't get it. >> >> Although YAML accepts your indentation, yamllint does not and we always, >> always, expected yamllint flavor of syntax. > > That's chill, however I can't reproduce this, make dt_bindings_check in the > mainline kernel does not yield this warning (after pip install > --upgrade --user dtschema > and yamllint is installed and all), so right now my only way of testing this > patch is to mail it to the mailing list and have it tested by Rob's bot. Just tried on top of next/master and v6.5: correctly report this warning from yamllint. Maybe you do not have yamlling installed or you have Python mismatches (e.g. yamllint installed for Python2 but use Python3 here). > > I just don't understand what I'm supposed to do... drop the dash-space "- " in > front of "- ports"? Then the bot will be happy? Missing two spaces, so 6 -> 8 spaces. Best regards, Krzysztof
On Fri, Oct 20, 2023 at 01:41:22PM +0200, Linus Walleij wrote: > I can't reproduce this, make dt_bindings_check in the mainline kernel > does not yield this warning You used the actual command that the bot posted, right? aka "make DT_CHECKER_FLAGS=-m dt_binding_check"? I am also seeing the yamllint warning.
On Fri, Oct 20, 2023 at 2:27 PM Vladimir Oltean <olteanv@gmail.com> wrote: > On Fri, Oct 20, 2023 at 01:41:22PM +0200, Linus Walleij wrote: > > I can't reproduce this, make dt_bindings_check in the mainline kernel > > does not yield this warning > > You used the actual command that the bot posted, right? aka "make DT_CHECKER_FLAGS=-m dt_binding_check"? > I am also seeing the yamllint warning. Yep I added that. (But I think the kernels dt_binding_check should ultimately add the same flag, otherwise the world gets super confusing.) Yours, Linus Walleij
diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml index 6107189d276a..368169f7fd37 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml @@ -46,4 +46,10 @@ $defs: $ref: dsa-port.yaml# unevaluatedProperties: false + oneOf: + - required: + - ports + - required: + - ethernet-ports + ...