devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Maxime Ripard <maxime@cerno.tech>,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH 1/2] dt-bindings: kbuild: Pass DT_SCHEMA_FILES to dt-validate
Date: Fri, 4 Mar 2022 08:03:51 -0600	[thread overview]
Message-ID: <YiIcRzBjuCgY7OMV@robh.at.kernel.org> (raw)
In-Reply-To: <YiH8lWq8gOnaQ+7G@pendragon.ideasonboard.com>

On Fri, Mar 04, 2022 at 01:48:37PM +0200, Laurent Pinchart wrote:
> On Thu, Mar 03, 2022 at 04:42:36PM -0600, Rob Herring wrote:
> > In preparation for supporting validation of DTB files, the full
> > processed schema will always be needed in order to extract type
> > information from it. Therefore, the processed schema containing only
> > what DT_SCHEMA_FILES specifies won't work. Instead, dt-validate has
> > gained an option, -l or --limit, to specify which schema(s) to use for
> > validation.
> > 
> > As the command line option is new, we the minimum dtschema version must be
> > updated.
> > 
> > Cc: Masahiro Yamada <masahiroy@kernel.org>
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  Documentation/devicetree/bindings/Makefile | 28 +++-------------------
> >  scripts/Makefile.lib                       |  3 +--
> >  2 files changed, 4 insertions(+), 27 deletions(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/Makefile b/Documentation/devicetree/bindings/Makefile
> > index 61ec18ecc931..246ba0ecab64 100644
> > --- a/Documentation/devicetree/bindings/Makefile
> > +++ b/Documentation/devicetree/bindings/Makefile
> > @@ -6,7 +6,7 @@ DT_MK_SCHEMA ?= dt-mk-schema
> >  DT_SCHEMA_LINT := $(shell which yamllint || \
> >    echo "warning: yamllint not installed, skipping. To install, run 'pip install yamllint'" >&2)
> >  
> > -DT_SCHEMA_MIN_VERSION = 2021.2.1
> > +DT_SCHEMA_MIN_VERSION = 2022.3
> >  
> >  PHONY += check_dtschema_version
> >  check_dtschema_version:
> > @@ -25,9 +25,6 @@ quiet_cmd_extract_ex = DTEX    $@
> >  $(obj)/%.example.dts: $(src)/%.yaml check_dtschema_version FORCE
> >  	$(call if_changed,extract_ex)
> >  
> > -# Use full schemas when checking %.example.dts
> > -DT_TMP_SCHEMA := $(obj)/processed-schema-examples.json
> > -
> >  find_all_cmd = find $(srctree)/$(src) \( -name '*.yaml' ! \
> >  		-name 'processed-schema*' ! \
> >  		-name '*.example.dt.yaml' \)
> > @@ -70,29 +67,10 @@ override DTC_FLAGS := \
> >  # Disable undocumented compatible checks until warning free
> >  override DT_CHECKER_FLAGS ?=
> >  
> > -$(obj)/processed-schema-examples.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE
> > +$(obj)/processed-schema.json: $(DT_DOCS) $(src)/.yamllint check_dtschema_version FORCE
> >  	$(call if_changed_rule,chkdt)
> >  
> > -ifeq ($(DT_SCHEMA_FILES),)
> > -
> > -# Unless DT_SCHEMA_FILES is specified, use the full schema for dtbs_check too.
> > -# Just copy processed-schema-examples.json
> > -
> > -$(obj)/processed-schema.json: $(obj)/processed-schema-examples.json FORCE
> > -	$(call if_changed,copy)
> > -
> > -else
> > -
> > -# If DT_SCHEMA_FILES is specified, use it for processed-schema.json
> > -
> > -$(obj)/processed-schema.json: DT_MK_SCHEMA_FLAGS := -u
> > -$(obj)/processed-schema.json: $(CHK_DT_DOCS) check_dtschema_version FORCE
> > -	$(call if_changed,mk_schema)
> > -
> > -endif
> > -
> > -always-$(CHECK_DT_BINDING) += processed-schema-examples.json
> > -always-$(CHECK_DTBS)       += processed-schema.json
> > +always-y += processed-schema.json
> >  always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dts, $(CHK_DT_DOCS))
> >  always-$(CHECK_DT_BINDING) += $(patsubst $(srctree)/$(src)/%.yaml,%.example.dt.yaml, $(CHK_DT_DOCS))
> >  
> > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> > index 79be57fdd32a..9f1e8442564e 100644
> > --- a/scripts/Makefile.lib
> > +++ b/scripts/Makefile.lib
> > @@ -361,9 +361,8 @@ $(multi-dtb-y): FORCE
> >  $(call multi_depend, $(multi-dtb-y), .dtb, -dtbs)
> >  
> >  DT_CHECKER ?= dt-validate
> > -DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),,-m)
> > +DT_CHECKER_FLAGS ?= $(if $(DT_SCHEMA_FILES),-l $(DT_SCHEMA_FILES),-m)
> >  DT_BINDING_DIR := Documentation/devicetree/bindings
> > -# DT_TMP_SCHEMA may be overridden from Documentation/devicetree/bindings/Makefile
> >  DT_TMP_SCHEMA ?= $(objtree)/$(DT_BINDING_DIR)/processed-schema.json
> 
> This could now use := instead of ?=

Yes, though I think it is possible we may still want to override it. 
Other than debugging perhaps, I don't have an immediate reason.

> Apart from the fact that 2022.3 hasn't been tagged yet as pointed out by
> Geert, this looks fine to me (but I'm no expert in this area).

It's now there.

Rob

  reply	other threads:[~2022-03-04 14:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 22:42 [PATCH 0/2] dt-bindings: DTB based validation Rob Herring
2022-03-03 22:42 ` [PATCH 1/2] dt-bindings: kbuild: Pass DT_SCHEMA_FILES to dt-validate Rob Herring
2022-03-04  9:32   ` Geert Uytterhoeven
2022-03-04 13:57     ` Rob Herring
2022-03-04 14:05       ` Geert Uytterhoeven
2022-03-04 14:30         ` Rob Herring
2022-03-04 14:49           ` Geert Uytterhoeven
2022-03-10 15:49             ` Rob Herring
2022-03-04 11:48   ` Laurent Pinchart
2022-03-04 14:03     ` Rob Herring [this message]
2022-03-03 22:42 ` [PATCH 2/2] dt-bindings: kbuild: Use DTB files for validation Rob Herring
2022-03-04 11:55   ` Laurent Pinchart
2022-03-04 14:07     ` Rob Herring
2022-03-07 12:20   ` Geert Uytterhoeven
2022-03-07 17:00     ` Rob Herring
2022-03-08  8:37       ` Geert Uytterhoeven

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=YiIcRzBjuCgY7OMV@robh.at.kernel.org \
    --to=robh@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=maxime@cerno.tech \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.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;
as well as URLs for NNTP newsgroup(s).