devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	 Nicolas Schier <nicolas@fjasle.eu>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	 Conor Dooley <conor+dt@kernel.org>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	 Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Alim Akhtar <alim.akhtar@samsung.com>,
	 Conor Dooley <conor@kernel.org>,
	linux-kbuild@vger.kernel.org,  linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org,  linux-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	 linux-samsung-soc@vger.kernel.org
Subject: Re: [PATCH v2 0/4] kbuild: Per arch/platform dtc warning levels
Date: Thu, 30 Nov 2023 02:49:21 +0900	[thread overview]
Message-ID: <CAK7LNARrRwzrU0m0SVOfnJj87hw4kL2YpDK0xRCwuW6fYT9OGg@mail.gmail.com> (raw)
In-Reply-To: <CAL_JsqJSFnVG6+CfcbgVFGo3EyiSTt-et0NSW2qWjei+zXURcg@mail.gmail.com>

On Wed, Nov 29, 2023 at 7:25 AM Rob Herring <robh@kernel.org> wrote:
>
> On Tue, Nov 28, 2023 at 6:03 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > On Mon, Nov 27, 2023 at 11:03 PM Rob Herring <robh@kernel.org> wrote:
> > >
> > > On Thu, Nov 23, 2023 at 1:39 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> > > >
> > > > On Thu, Nov 23, 2023 at 7:12 AM Rob Herring <robh@kernel.org> wrote:
> > > > >
> > > > > This series adds support to set the dtc extra warning level on a per
> > > > > arch or per platform (directory really) basis.
> > > > >
> > > > > The first version of this was just a simple per directory override for
> > > > > Samsung platforms, but Conor asked to be able to do this for all of
> > > > > riscv.
> > > > >
> > > > > For merging, either I can take the whole thing or the riscv and samsung
> > > > > patches can go via their normal trees. The added variable will have no
> > > > > effect until merged with patch 2.
> > > > >
> > > > > v1:
> > > > >  - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kernel.org/
> > > > >
> > > > > Signed-off-by: Rob Herring <robh@kernel.org>
> > > > > ---
> > > >
> > > >
> > > > There were some attempts in the past to enable W=1 in particular subsystems,
> > > > so here is a similar comment.
> > > >
> > > > Adding a new warning flag to W=1 is always safe without doing any compile test.
> > > >
> > > > With this series, it would not be true any more because a new warning in W=1
> > > > would potentially break riscv/samsung platforms.
> > >
> > > The difference here is the people potentially adding warnings are also
> > > the ones ensuring no warnings.
> > >
> > > > Linus requires a clean build (i.e. zero warning) when W= option is not given.
> > >
> > > Linus doesn't build any of this AFAICT. We are not always warning free
> > > for W=0 with dtbs.
> >
> >
> >
> > Does it mean, you can enable all warnings by default?
>
> No, Linus might not care, but others (me) do. The whole point of not
> allowing warnings is the same. Get to zero warnings so any new
> warnings stand out. We now have some subset of platforms which are
> warning free and want warnings enabled by default to keep them that
> way. How do you suggest we do that?





You may not like it, but an alternative solution could be,
hard-code extra warning flags.


In my compile-tests, Samsung platform is not W=1 clean yet.
I see -Wunit_address_vs_reg, -Wsimple_bus_reg,
-Wunique_unit_address_if_enabled warnings.

I do not see anything else, so you can add the following three
flags to keep it warning-free.






diff --git a/arch/arm/boot/dts/samsung/Makefile
b/arch/arm/boot/dts/samsung/Makefile
index 7becf36656b1..1e15784ec51f 100644
--- a/arch/arm/boot/dts/samsung/Makefile
+++ b/arch/arm/boot/dts/samsung/Makefile
@@ -1,4 +1,10 @@
 # SPDX-License-Identifier: GPL-2.0
+
+dtcflags := \
+       -Wavoid_unnecessary_addr_size \
+       -Walias_paths \
+       -Wgraph_child_address
+
 dtb-$(CONFIG_ARCH_EXYNOS3) += \
        exynos3250-artik5-eval.dtb \
        exynos3250-monk.dtb \
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 1a965fe68e01..aa5a5fc39cec 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -362,6 +362,9 @@ DTC_FLAGS += -Wnode_name_chars_strict \
        -Wunique_unit_address
 endif

+# per-directory flags
+DTC_FLAGS += $(dtcflags)
+# per-file flags
 DTC_FLAGS += $(DTC_FLAGS_$(basetarget))

 # Set -@ if the target is a base DTB that overlay is applied onto







>
> I understand your point on W=1 in general, but I think it just doesn't
> apply in this case. In general,
> someone may be testing a new compiler and there's some new warning to
> enable, so they add it to W=1. They are working independently of any
> subsystem (and Linus) and introducing new warnings would be a burden
> to fix and a problem to leave. For DT, it is a bit different as adding
> new warnings, updating dtc version, and selecting warnings to enable
> are pretty much all done together.
> Plus, schema warnings have pretty
> much superseded dtc warnings. If we do add new warnings which can't be
> fixed up front, then we could still only enable the warning for W=1
> from the command line. Something like this on top of this series:
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 53a74e53e0ca..41307c6e1fee 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -341,6 +341,10 @@ quiet_cmd_gzip = GZIP    $@
>  # ---------------------------------------------------------------------------
>  DTC ?= $(objtree)/scripts/dtc/dtc
>
> +ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),)
> +DTC_FLAGS += -Wno-some_new_warning_we_need_off_globally
> +endif
> +

Hmm. Tricky, but works.

KBUILD_EXTRA_WARN_DTC=1 is weaker than KBUILD_EXTRA_WARN=1




>  KBUILD_EXTRA_WARN_DTC += $(KBUILD_EXTRA_WARN)
>
>  # Disable noisy checks by default
>
--
Best Regards
Masahiro Yamada

  reply	other threads:[~2023-11-29 17:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 22:12 [PATCH v2 0/4] kbuild: Per arch/platform dtc warning levels Rob Herring
2023-11-22 22:12 ` [PATCH v2 1/4] kbuild: Move dtc graph_child_address warning to W=2 Rob Herring
2023-11-22 22:12 ` [PATCH v2 2/4] kbuild: Allow arch/platform override of dtc warning level Rob Herring
2023-11-22 22:12 ` [PATCH v2 3/4] riscv: dts: Always enable extra W=1 warnings Rob Herring
2023-11-22 22:12 ` [PATCH v2 4/4] arm/arm64: dts: samsung: " Rob Herring
2023-11-23  7:18   ` Krzysztof Kozlowski
2023-11-23  7:38 ` [PATCH v2 0/4] kbuild: Per arch/platform dtc warning levels Masahiro Yamada
2023-11-23  9:43   ` Conor Dooley
2023-11-23 12:00     ` Masahiro Yamada
2023-11-27 14:03   ` Rob Herring
2023-11-28 12:02     ` Masahiro Yamada
2023-11-28 22:25       ` Rob Herring
2023-11-29 17:49         ` Masahiro Yamada [this message]
2023-11-23  9:47 ` Conor Dooley

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=CAK7LNARrRwzrU0m0SVOfnJj87hw4kL2YpDK0xRCwuW6fYT9OGg@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=alim.akhtar@samsung.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=conor@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    /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).