* [PATCH] kbuild: Optionally enable schema checks for %.dtb targets
@ 2022-12-20 1:32 Rob Herring
2022-12-20 2:45 ` Marek Vasut
2022-12-20 12:59 ` Masahiro Yamada
0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring @ 2022-12-20 1:32 UTC (permalink / raw)
To: Masahiro Yamada, Nathan Chancellor, Nick Desaulniers,
Nicolas Schier
Cc: Marek Vasut, Dmitry Baryshkov, linux-kbuild, linux-kernel
While not documented, schema checks for single dtb targets mostly work
already by setting 'CHECK_DTBS=1'. However, the dependencies are not
handled and it only works if 'make dt_bindings_check' was run first and
generated processed-schema.json. In addition, changing a binding file
doesn't cause the schema to be rebuilt and dtb to be revalidated.
Making this work turns out to be simple. Whenever CHECK_DTBS is set,
make 'dt_binding_check' a 'dtbs_prepare' dependency.
I reimplemented here what Masahiro had originally come up with a while
back.
Cc: Marek Vasut <marex@denx.de>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 6aa709df6bde..a99d5c4de0fc 100644
--- a/Makefile
+++ b/Makefile
@@ -1467,7 +1467,10 @@ dtbs_prepare: include/config/kernel.release scripts_dtc
ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
export CHECK_DTBS=y
-dtbs: dt_binding_check
+endif
+
+ifneq ($(CHECK_DTBS),)
+dtbs_prepare: dt_binding_check
endif
dtbs_check: dtbs
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: Optionally enable schema checks for %.dtb targets
2022-12-20 1:32 [PATCH] kbuild: Optionally enable schema checks for %.dtb targets Rob Herring
@ 2022-12-20 2:45 ` Marek Vasut
2022-12-20 12:59 ` Masahiro Yamada
1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2022-12-20 2:45 UTC (permalink / raw)
To: Rob Herring, Masahiro Yamada, Nathan Chancellor, Nick Desaulniers,
Nicolas Schier
Cc: Dmitry Baryshkov, linux-kbuild, linux-kernel
On 12/20/22 02:32, Rob Herring wrote:
> While not documented, schema checks for single dtb targets mostly work
> already by setting 'CHECK_DTBS=1'. However, the dependencies are not
> handled and it only works if 'make dt_bindings_check' was run first and
> generated processed-schema.json. In addition, changing a binding file
> doesn't cause the schema to be rebuilt and dtb to be revalidated.
>
> Making this work turns out to be simple. Whenever CHECK_DTBS is set,
> make 'dt_binding_check' a 'dtbs_prepare' dependency.
>
> I reimplemented here what Masahiro had originally come up with a while
> back.
>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> Makefile | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 6aa709df6bde..a99d5c4de0fc 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1467,7 +1467,10 @@ dtbs_prepare: include/config/kernel.release scripts_dtc
>
> ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
> export CHECK_DTBS=y
> -dtbs: dt_binding_check
> +endif
> +
> +ifneq ($(CHECK_DTBS),)
> +dtbs_prepare: dt_binding_check
> endif
>
> dtbs_check: dtbs
Tested-by: Marek Vasut <marex@denx.de>
Thank you!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: Optionally enable schema checks for %.dtb targets
2022-12-20 1:32 [PATCH] kbuild: Optionally enable schema checks for %.dtb targets Rob Herring
2022-12-20 2:45 ` Marek Vasut
@ 2022-12-20 12:59 ` Masahiro Yamada
1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2022-12-20 12:59 UTC (permalink / raw)
To: Rob Herring
Cc: Nathan Chancellor, Nick Desaulniers, Nicolas Schier, Marek Vasut,
Dmitry Baryshkov, linux-kbuild, linux-kernel
On Tue, Dec 20, 2022 at 10:32 AM Rob Herring <robh@kernel.org> wrote:
>
> While not documented, schema checks for single dtb targets mostly work
> already by setting 'CHECK_DTBS=1'. However, the dependencies are not
> handled and it only works if 'make dt_bindings_check' was run first and
> generated processed-schema.json. In addition, changing a binding file
> doesn't cause the schema to be rebuilt and dtb to be revalidated.
>
> Making this work turns out to be simple. Whenever CHECK_DTBS is set,
> make 'dt_binding_check' a 'dtbs_prepare' dependency.
>
> I reimplemented here what Masahiro had originally come up with a while
> back.
Oh, I just recalled this patch.
https://lore.kernel.org/all/CAA8EJprdCftvie3UF9QpCWr9oQ5SQbqW8OPOHg0qigf9=RXU-w@mail.gmail.com/T/#m2ce6b1de3c74333645831399c0d1775129d7661a
Dritry tested it.
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> Makefile | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 6aa709df6bde..a99d5c4de0fc 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1467,7 +1467,10 @@ dtbs_prepare: include/config/kernel.release scripts_dtc
>
> ifneq ($(filter dtbs_check, $(MAKECMDGOALS)),)
> export CHECK_DTBS=y
> -dtbs: dt_binding_check
> +endif
> +
> +ifneq ($(CHECK_DTBS),)
> +dtbs_prepare: dt_binding_check
> endif
>
> dtbs_check: dtbs
> --
> 2.35.1
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-12-20 13:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-20 1:32 [PATCH] kbuild: Optionally enable schema checks for %.dtb targets Rob Herring
2022-12-20 2:45 ` Marek Vasut
2022-12-20 12:59 ` Masahiro Yamada
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox