Message ID | 20221102214300.309347-1-nfraprado@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp161889wru; Wed, 2 Nov 2022 14:56:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7g4IoR2W2O9J0W+T8g/GclSs8dVa7RJCj8q6D/I6JvkLpVFuqFpf8kA8C5k6XrXybCbkLc X-Received: by 2002:a17:906:7949:b0:7ac:9917:90b9 with SMTP id l9-20020a170906794900b007ac991790b9mr25461410ejo.536.1667426167565; Wed, 02 Nov 2022 14:56:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667426167; cv=none; d=google.com; s=arc-20160816; b=EuChF5JpAzDD0dkcZbqaIM8pMQPtrCFSR6bpvavSihC1Q25NhNszGv3lBq91cj/IxM 9Fa9zKn6oZPajFAzQ5wnr/KZgYTUgzpcPj/++ujkYYqmGDbC54x478cvWRft3yd8oz2k JlIneg6AouuiHRvKEWfmSQfed5T1TnCzIukI5cgmxKXkVnjrZ/GmuGeWb4lbuBOONEjE zvCFaYxinnbSNMwAQ4yEa6+4N7o2lVGmJG8fcxG8eDeWe5xXdGtK2HEaS7/5nQUhq/4y yuRfRQYg+1wg50+DhPJVq839WQiN9rtxU4i3lJlg6CMJg1djRyheyLrkAs/bx8BZAgBS YrKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=v5991RrXScJhmv3IUMGcu52NKLks7Sr9R7RvijLy0Po=; b=T/jRDgSpPqcVtAEOra64VPNrRkSdJ99iSOPT6gEraIOjh9XYrfc1DilrfbW3p8pR+8 D62YLQz6QdfzjOXAuq3pXPB5v10jgev45FMlKZ1/kX7AbGBzyetoBcu0MEXihQ/xX7Se jNWagANtXG2pwilfLCxM+qg1Ee3jxnQaFuBrK8V58Xf7RFZN61A88iDy6dezRoFXULgg c1OLLBR/aapVDG3qXanofbnqA1kn4Al50AGl/KoTFPD7iTTkLgzw5GjAyRRAT1w70O7m umYQlDZ6DI9gF8HG6yCnToVXPjFR9jrtqV1XpYO+yz+WrZnM9374Q42orNLPw1p8icf3 5h7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=dFDgAJLb; 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=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w3-20020a05640234c300b0043dfc949d31si20294803edc.25.2022.11.02.14.55.43; Wed, 02 Nov 2022 14:56:07 -0700 (PDT) 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; dkim=pass header.i=@collabora.com header.s=mail header.b=dFDgAJLb; 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=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbiKBVnJ (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Wed, 2 Nov 2022 17:43:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229708AbiKBVnH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Nov 2022 17:43:07 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 16E8F6591; Wed, 2 Nov 2022 14:43:07 -0700 (PDT) Received: from notapiano.myfiosgateway.com (unknown [IPv6:2600:4041:5b1a:cd00:524d:e95d:1a9c:492a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id BF48C660037C; Wed, 2 Nov 2022 21:43:03 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1667425385; bh=I6k0VYTBtgXqylue8+whQkMj2wwlEM89xgbgwhw/Gmg=; h=From:To:Cc:Subject:Date:From; b=dFDgAJLbSFI9EOSca34tAKkHzdhLLdsf9vnQaR0Cj4ijTC5sqJoLsaeZn+rGY1jb6 U6X1C7odwcSRrtrUaMkS4wwAoXiiWuwbYXxswZBS/MoSVB7LY9AlgGvbNvMbSFTuU2 jjAuXo3zpDnwoHnrkdtpRg/0Q89AiQr17/T2VxqhPDyt2EmbR1c0wDcggEYth7R1Of kyvmIb2DOC2+/uDdqom/3gfaKCs1wWZCun5vXp7ysr76L0n+OZaQ368qfxswpO6MDG YqQkW5COIllOaScVlOUvE45dtf/EUl2TiKmOpPx/lY4/4OmmOb5jyIiVJ0y+z1V3qv n0XRk4mlOJWjA== From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com> To: Rob Herring <robh+dt@kernel.org> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, kernel@collabora.com, =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Matthias Brugger <matthias.bgg@gmail.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org Subject: [PATCH] docs: dt: writing-schema: Document usage of CHECK_DTBS make flag Date: Wed, 2 Nov 2022 17:43:00 -0400 Message-Id: <20221102214300.309347-1-nfraprado@collabora.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748423060809759186?= X-GMAIL-MSGID: =?utf-8?q?1748423060809759186?= |
Series |
docs: dt: writing-schema: Document usage of CHECK_DTBS make flag
|
|
Commit Message
Nícolas F. R. A. Prado
Nov. 2, 2022, 9:43 p.m. UTC
It is possible to run checks on a Devicetree by passing the CHECK_DTBS
flag when building. This is a useful shortcut to the dtbs_check make
target since it avoids checking unrelated Devicetrees, which can take
some time and is unnecessary if no bindings were modified. Document it.
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
---
Documentation/devicetree/bindings/writing-schema.rst | 7 +++++++
1 file changed, 7 insertions(+)
Comments
Il 02/11/22 22:43, Nícolas F. R. A. Prado ha scritto: > It is possible to run checks on a Devicetree by passing the CHECK_DTBS > flag when building. This is a useful shortcut to the dtbs_check make > target since it avoids checking unrelated Devicetrees, which can take > some time and is unnecessary if no bindings were modified. Document it. > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > --- > > Documentation/devicetree/bindings/writing-schema.rst | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Documentation/devicetree/bindings/writing-schema.rst b/Documentation/devicetree/bindings/writing-schema.rst > index 4a381d20f2b4..55ad556472b4 100644 > --- a/Documentation/devicetree/bindings/writing-schema.rst > +++ b/Documentation/devicetree/bindings/writing-schema.rst > @@ -167,6 +167,13 @@ setting the ``DT_SCHEMA_FILES`` variable to a specific schema file or pattern. > make dt_binding_check DT_SCHEMA_FILES=/gpio/ > make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml > > +Note that ``make dtbs_check`` will validate every DT source file that is "Note that xxxx" looks a bit repeated... read: Note that ``dtbs_check`` will skip any binding schema files with errors. (etc etc) Note that ``make dtbs_check`` will validate every DT source file ... (etc etc) Perhaps we can change the first paragraph saying "In order to perform validation of DT source files, use..." to something like: In order to perform validation of all DT source files, use the ``dtbs_check`` target, or set the ``CHECK_DTBS`` variable to ``y`` when building specific DTs:: :: make dtbs_check make CHECK_DTBS=y mediatek/mt8192-evb.dtb Any opinion? Cheers, Angelo
On Thu, Nov 03, 2022 at 10:19:15AM +0100, AngeloGioacchino Del Regno wrote: > Il 02/11/22 22:43, Nícolas F. R. A. Prado ha scritto: > > It is possible to run checks on a Devicetree by passing the CHECK_DTBS > > flag when building. This is a useful shortcut to the dtbs_check make > > target since it avoids checking unrelated Devicetrees, which can take > > some time and is unnecessary if no bindings were modified. Document it. > > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > > --- > > > > Documentation/devicetree/bindings/writing-schema.rst | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/writing-schema.rst b/Documentation/devicetree/bindings/writing-schema.rst > > index 4a381d20f2b4..55ad556472b4 100644 > > --- a/Documentation/devicetree/bindings/writing-schema.rst > > +++ b/Documentation/devicetree/bindings/writing-schema.rst > > @@ -167,6 +167,13 @@ setting the ``DT_SCHEMA_FILES`` variable to a specific schema file or pattern. > > make dt_binding_check DT_SCHEMA_FILES=/gpio/ > > make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml > > +Note that ``make dtbs_check`` will validate every DT source file that is > > "Note that xxxx" looks a bit repeated... read: > > Note that ``dtbs_check`` will skip any binding schema files with errors. > (etc etc) > > Note that ``make dtbs_check`` will validate every DT source file ... > (etc etc) > > Perhaps we can change the first paragraph saying > "In order to perform validation of DT source files, use..." > to something like: > > In order to perform validation of all DT source files, use the ``dtbs_check`` > target, or set the ``CHECK_DTBS`` variable to ``y`` when building specific DTs:: > > :: > > make dtbs_check > make CHECK_DTBS=y mediatek/mt8192-evb.dtb > > Any opinion? Something to keep in mind is that the purpose of this section is to describe how to validate binding changes (both on the binding itself and in the DTs that use them). For this, people really should be using dtbs_check since otherwise a new warning might be missed. Using CHECK_DTBS is more suitable for a different use case, which is to validate some dtbs without having changed the bindings, which is why I added it at the end of the section more as a side note. For this reason I think it's better to keep them separate. About repeating the "Note that", that could just be changed for "It's worth noting that" or something similar. Thanks, Nícolas
Hi Nícolas, On 2022-11-02 17:43:00, Nícolas F. R. A. Prado wrote: > It is possible to run checks on a Devicetree by passing the CHECK_DTBS > flag when building. This is a useful shortcut to the dtbs_check make > target since it avoids checking unrelated Devicetrees, which can take > some time and is unnecessary if no bindings were modified. Document it. > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > --- > > Documentation/devicetree/bindings/writing-schema.rst | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/Documentation/devicetree/bindings/writing-schema.rst b/Documentation/devicetree/bindings/writing-schema.rst > index 4a381d20f2b4..55ad556472b4 100644 > --- a/Documentation/devicetree/bindings/writing-schema.rst > +++ b/Documentation/devicetree/bindings/writing-schema.rst > @@ -167,6 +167,13 @@ setting the ``DT_SCHEMA_FILES`` variable to a specific schema file or pattern. > make dt_binding_check DT_SCHEMA_FILES=/gpio/ > make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml > > +Note that ``make dtbs_check`` will validate every DT source file that is > +enabled. When making changes to a DT but not to the bindings, a possible > +shortcut to validate only the DT in question is to explicitly build it with > +the ``CHECK_DTBS`` flag enabled. For example:: > + > + make CHECK_DTBS=y mediatek/mt8192-evb.dtb I have a bit of trouble getting this to work on a _clean_ out directory (perhaps this should have been reported at the original patch, I had always been using Dmitry's version [1] which didn't suffer from this problem). Consider running with the following: rm out -r make ARCH=arm64 O=out defconfig make ARCH=arm64 O=out CHECK_DTBS=y qcom/sm8450-sony-xperia-nagara-pdx223.dtb After compiling preliminaries, it exits with: make[3]: *** No rule to make target 'arch/arm64/boot/dts/qcom/sm8450-sony-xperia-nagara-pdx223.dtb'. Stop. make[2]: *** [../scripts/Makefile.build:500: arch/arm64/boot/dts/qcom] Error 2 make[1]: *** [/kernel/Makefile:1460: qcom/sm8450-sony-xperia-nagara-pdx223.dtb] Error 2 make[1]: Leaving directory '/kernel/out' make: *** [Makefile:231: __sub-make] Error 2 However, if I lint all DTBs first by running `dtbs_check`, it seems the schema preliminaries are built: LINT Documentation/devicetree/bindings CHKDT Documentation/devicetree/bindings/processed-schema.json ... bunch of warnings SCHEMA Documentation/devicetree/bindings/processed-schema.json And here I ctrl+c the build so that it doesn't run DTC_CHK over every dts. If I now re-run the original command on my .dtb of choice, it completes successfully with the warnings that I expect. Is the logic behind `CHECK_DTBS=y` simply missing a step to make sure SCHEMA is built and up-to-date? Aside from not working in a clean output directly, could this imply schema changes (edits in Documentation/devicetree/bindings) _are not_ propagated when running with `CHECK_DTBS=y? At the same time running this command twice results in no output the second time around, supposedly because the dtb has "already been built". Is that also something we can improve? [1]: https://lore.kernel.org/linux-arm-msm/20220623144357.297252-1-dmitry.baryshkov@linaro.org/ Thanks! - Marijn
+CC Konrad and Dmitry whom I discussed this with before. On 2022-11-16 14:55:04, Marijn Suijten wrote: > Hi Nícolas, > > On 2022-11-02 17:43:00, Nícolas F. R. A. Prado wrote: > > It is possible to run checks on a Devicetree by passing the CHECK_DTBS > > flag when building. This is a useful shortcut to the dtbs_check make > > target since it avoids checking unrelated Devicetrees, which can take > > some time and is unnecessary if no bindings were modified. Document it. > > > > Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com> > > > > --- > > > > Documentation/devicetree/bindings/writing-schema.rst | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/writing-schema.rst b/Documentation/devicetree/bindings/writing-schema.rst > > index 4a381d20f2b4..55ad556472b4 100644 > > --- a/Documentation/devicetree/bindings/writing-schema.rst > > +++ b/Documentation/devicetree/bindings/writing-schema.rst > > @@ -167,6 +167,13 @@ setting the ``DT_SCHEMA_FILES`` variable to a specific schema file or pattern. > > make dt_binding_check DT_SCHEMA_FILES=/gpio/ > > make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml > > > > +Note that ``make dtbs_check`` will validate every DT source file that is > > +enabled. When making changes to a DT but not to the bindings, a possible > > +shortcut to validate only the DT in question is to explicitly build it with > > +the ``CHECK_DTBS`` flag enabled. For example:: > > + > > + make CHECK_DTBS=y mediatek/mt8192-evb.dtb > > I have a bit of trouble getting this to work on a _clean_ out directory > (perhaps this should have been reported at the original patch, I had > always been using Dmitry's version [1] which didn't suffer from this > problem). > > Consider running with the following: > > rm out -r > make ARCH=arm64 O=out defconfig > make ARCH=arm64 O=out CHECK_DTBS=y qcom/sm8450-sony-xperia-nagara-pdx223.dtb > > After compiling preliminaries, it exits with: > > make[3]: *** No rule to make target 'arch/arm64/boot/dts/qcom/sm8450-sony-xperia-nagara-pdx223.dtb'. Stop. > make[2]: *** [../scripts/Makefile.build:500: arch/arm64/boot/dts/qcom] Error 2 > make[1]: *** [/kernel/Makefile:1460: qcom/sm8450-sony-xperia-nagara-pdx223.dtb] Error 2 > make[1]: Leaving directory '/kernel/out' > make: *** [Makefile:231: __sub-make] Error 2 > > However, if I lint all DTBs first by running `dtbs_check`, it seems the > schema preliminaries are built: > > LINT Documentation/devicetree/bindings > CHKDT Documentation/devicetree/bindings/processed-schema.json > ... bunch of warnings > SCHEMA Documentation/devicetree/bindings/processed-schema.json > > And here I ctrl+c the build so that it doesn't run DTC_CHK over every > dts. If I now re-run the original command on my .dtb of choice, it > completes successfully with the warnings that I expect. Is the logic > behind `CHECK_DTBS=y` simply missing a step to make sure SCHEMA is built > and up-to-date? > > Aside from not working in a clean output directly, could this imply > schema changes (edits in Documentation/devicetree/bindings) _are not_ > propagated when running with `CHECK_DTBS=y? > > At the same time running this command twice results in no output the > second time around, supposedly because the dtb has "already been built". > Is that also something we can improve? > > [1]: https://lore.kernel.org/linux-arm-msm/20220623144357.297252-1-dmitry.baryshkov@linaro.org/ > > Thanks! > - Marijn >
diff --git a/Documentation/devicetree/bindings/writing-schema.rst b/Documentation/devicetree/bindings/writing-schema.rst index 4a381d20f2b4..55ad556472b4 100644 --- a/Documentation/devicetree/bindings/writing-schema.rst +++ b/Documentation/devicetree/bindings/writing-schema.rst @@ -167,6 +167,13 @@ setting the ``DT_SCHEMA_FILES`` variable to a specific schema file or pattern. make dt_binding_check DT_SCHEMA_FILES=/gpio/ make dtbs_check DT_SCHEMA_FILES=trivial-devices.yaml +Note that ``make dtbs_check`` will validate every DT source file that is +enabled. When making changes to a DT but not to the bindings, a possible +shortcut to validate only the DT in question is to explicitly build it with +the ``CHECK_DTBS`` flag enabled. For example:: + + make CHECK_DTBS=y mediatek/mt8192-evb.dtb + json-schema Resources ---------------------