diff mbox series

[1/2] dt-bindings: kbuild: Pass DT_SCHEMA_FILES to dt-validate

Message ID 20220303224237.2497570-2-robh@kernel.org (mailing list archive)
State New, archived
Headers show
Series [1/2] dt-bindings: kbuild: Pass DT_SCHEMA_FILES to dt-validate | expand

Commit Message

Rob Herring March 3, 2022, 10:42 p.m. UTC
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(-)

Comments

Geert Uytterhoeven March 4, 2022, 9:32 a.m. UTC | #1
Hi Rob,

On Thu, Mar 3, 2022 at 11:43 PM Rob Herring <robh@kernel.org> 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>

Thanks for your patch!

> --- 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

This doesn't work as-is, as that version hasn't been tagged yet ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Laurent Pinchart March 4, 2022, 11:48 a.m. UTC | #2
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 ?=

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).

>  
>  quiet_cmd_dtb_check =	CHECK   $@
Rob Herring March 4, 2022, 1:57 p.m. UTC | #3
On Fri, Mar 04, 2022 at 10:32:29AM +0100, Geert Uytterhoeven wrote:
> Hi Rob,
> 
> On Thu, Mar 3, 2022 at 11:43 PM Rob Herring <robh@kernel.org> 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>
> 
> Thanks for your patch!
> 
> > --- 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
> 
> This doesn't work as-is, as that version hasn't been tagged yet ;-)

I had to make sure people are paying attention. You win the prize. :)

It's there now.

Rob
Rob Herring March 4, 2022, 2:03 p.m. UTC | #4
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
Geert Uytterhoeven March 4, 2022, 2:05 p.m. UTC | #5
Hi Rob,

On Fri, Mar 4, 2022 at 2:57 PM Rob Herring <robh@kernel.org> wrote:
> On Fri, Mar 04, 2022 at 10:32:29AM +0100, Geert Uytterhoeven wrote:
> > On Thu, Mar 3, 2022 at 11:43 PM Rob Herring <robh@kernel.org> 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>
> >
> > Thanks for your patch!
> >
> > > --- 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
> >
> > This doesn't work as-is, as that version hasn't been tagged yet ;-)
>
> I had to make sure people are paying attention. You win the prize. :)
>
> It's there now.

Thanks, confirmed.

With this series applied, the various salvator-xs DTS files are now
throwing up:

    sata: size (19) error for type phandle
    backlight: size (11) error for type phandle

I tried to find out what caused that, but couldn't find it.
Do you have a clue?
Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Rob Herring March 4, 2022, 2:30 p.m. UTC | #6
On Fri, Mar 04, 2022 at 03:05:13PM +0100, Geert Uytterhoeven wrote:
> Hi Rob,
> 
> On Fri, Mar 4, 2022 at 2:57 PM Rob Herring <robh@kernel.org> wrote:
> > On Fri, Mar 04, 2022 at 10:32:29AM +0100, Geert Uytterhoeven wrote:
> > > On Thu, Mar 3, 2022 at 11:43 PM Rob Herring <robh@kernel.org> 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>
> > >
> > > Thanks for your patch!
> > >
> > > > --- 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
> > >
> > > This doesn't work as-is, as that version hasn't been tagged yet ;-)
> >
> > I had to make sure people are paying attention. You win the prize. :)
> >
> > It's there now.
> 
> Thanks, confirmed.
> 
> With this series applied, the various salvator-xs DTS files are now
> throwing up:
> 
>     sata: size (19) error for type phandle
>     backlight: size (11) error for type phandle

Those come from the code decoding the properties[1]. Unfortunately, I 
haven't come up with a prettier way to report those with the filename. I 
may just remove it because if decoding the property fails, we'll get 
schema errors later on anyways.

But I don't see any 'sata' properties in the DTS files and 'backlight' 
is a node. Are you building with '-@'? I probably need to skip 
__symbols__ nodes. The overlay side is handled because examples are 
built as overlays (to allow unresolved phandles).

Rob

[1] https://github.com/devicetree-org/dt-schema/blob/main/dtschema/dtb.py#L149
Geert Uytterhoeven March 4, 2022, 2:49 p.m. UTC | #7
Hi Rob,

On Fri, Mar 4, 2022 at 3:31 PM Rob Herring <robh@kernel.org> wrote:
> On Fri, Mar 04, 2022 at 03:05:13PM +0100, Geert Uytterhoeven wrote:
> > On Fri, Mar 4, 2022 at 2:57 PM Rob Herring <robh@kernel.org> wrote:
> > > On Fri, Mar 04, 2022 at 10:32:29AM +0100, Geert Uytterhoeven wrote:
> > > > On Thu, Mar 3, 2022 at 11:43 PM Rob Herring <robh@kernel.org> 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>

> > With this series applied, the various salvator-xs DTS files are now
> > throwing up:
> >
> >     sata: size (19) error for type phandle
> >     backlight: size (11) error for type phandle
>
> Those come from the code decoding the properties[1]. Unfortunately, I
> haven't come up with a prettier way to report those with the filename. I
> may just remove it because if decoding the property fails, we'll get
> schema errors later on anyways.
>
> But I don't see any 'sata' properties in the DTS files and 'backlight'
> is a node. Are you building with '-@'? I probably need to skip
> __symbols__ nodes. The overlay side is handled because examples are
> built as overlays (to allow unresolved phandles).

Yes I am. Dropping the "-@" fixes the issue.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Rob Herring March 10, 2022, 3:49 p.m. UTC | #8
On Fri, Mar 04, 2022 at 03:49:20PM +0100, Geert Uytterhoeven wrote:
> Hi Rob,
> 
> On Fri, Mar 4, 2022 at 3:31 PM Rob Herring <robh@kernel.org> wrote:
> > On Fri, Mar 04, 2022 at 03:05:13PM +0100, Geert Uytterhoeven wrote:
> > > On Fri, Mar 4, 2022 at 2:57 PM Rob Herring <robh@kernel.org> wrote:
> > > > On Fri, Mar 04, 2022 at 10:32:29AM +0100, Geert Uytterhoeven wrote:
> > > > > On Thu, Mar 3, 2022 at 11:43 PM Rob Herring <robh@kernel.org> 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>
> 
> > > With this series applied, the various salvator-xs DTS files are now
> > > throwing up:
> > >
> > >     sata: size (19) error for type phandle
> > >     backlight: size (11) error for type phandle
> >
> > Those come from the code decoding the properties[1]. Unfortunately, I
> > haven't come up with a prettier way to report those with the filename. I
> > may just remove it because if decoding the property fails, we'll get
> > schema errors later on anyways.
> >
> > But I don't see any 'sata' properties in the DTS files and 'backlight'
> > is a node. Are you building with '-@'? I probably need to skip
> > __symbols__ nodes. The overlay side is handled because examples are
> > built as overlays (to allow unresolved phandles).
> 
> Yes I am. Dropping the "-@" fixes the issue.

FYI, now fixed in v2022.03.1.

Rob
diff mbox series

Patch

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
 
 quiet_cmd_dtb_check =	CHECK   $@