Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4759643rdh; Wed, 29 Nov 2023 09:50:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGs8aIDc/ohgcU9kwauhNHnIF8EHib+fFPr0qnrdRcDHZTvJO1DFQtyMCmKB48DaeH3tjk X-Received: by 2002:a05:6830:4b3:b0:6d8:15ac:938c with SMTP id l19-20020a05683004b300b006d815ac938cmr16411544otd.0.1701280217931; Wed, 29 Nov 2023 09:50:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701280217; cv=none; d=google.com; s=arc-20160816; b=q5jCIyQVOs5r0SpLyZY5p3wM04uSqcnN2dd99jEUFkKqNWUIkPV/uUKzJ2HTUsNhfm Vsvvh+wy0/kOEVjxGLxjTKsFIjob+Rr9i37nHs01rADIeWuP+tx0bGTSXECxEy2F5doK 0U8mbRuHjSq55EdFfq3CQVnoICnh+VX79+duVk/BtvCmgWsipfv+APD0VpIxfDIb8b88 ZgTBMANSHm7OouZd6iVRZeMpWazugOch/wp6bBz58qSSNda0Q2qhEaqeD1/pGckCuUJG mdk6RAbsA4edmgvB8IyEDPdlpcsx2e09zFYBcL++sNUcSkTfZGDC8SAsbzcBBiKdVOvy Xg4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=lwVXvqvLVkpdC0fLt1O5mZpUaDsWQkLMRMJDtXafoVI=; fh=YXJCvSc/iMYw4x3kbSA0d5BBc0vucRlkVKOpdHHhx/A=; b=pAtQzR8jmiu/Z+limG7dKFCfmTYWgUp81/Zbi0mZBtTi+elP0aVOxJoExbAC1VsY8e sSA+QHNxqhGB8zRFInllnFLj8PY8RAxJ9fIBInplt606Xx3gDplvNXdmgFQq+qFkqm+q MDuJ8s1EHjXTlxLMaHFtXVuwnxcH52dPL0w+JVnqqrz6/2Lcyhl1SnXyVJzImfr3Hw20 I2FU7olHVUJpKjID+vUGb8OjSSH6/olKUazXbCUdwasG2vbabR1T60UPWw5o8vvms6Yo 5ioBEMK/T2U1t+48O71/8pSRaPhhKLe9Xd4bzfI8ipvuOcwyAe5eLxxGzznrHMMTqQOv 3Qtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HSZ0Bk+X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id r37-20020a635165000000b005bdd7cadb98si14847217pgl.54.2023.11.29.09.50.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 09:50:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HSZ0Bk+X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C5317804081D; Wed, 29 Nov 2023 09:50:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230432AbjK2Rtx (ORCPT + 99 others); Wed, 29 Nov 2023 12:49:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229501AbjK2Rtw (ORCPT ); Wed, 29 Nov 2023 12:49:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7328CA for ; Wed, 29 Nov 2023 09:49:58 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5A7F0C433C7; Wed, 29 Nov 2023 17:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701280198; bh=hOv0atHingnUJuqYGWuaNZX1Z0M6TjcYBZp5aRGip38=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=HSZ0Bk+XmVmFmLv332NYdThxfq4coZgxOk/QGCVmtzUcqbP97NlHYXwFbriiyC9FH d7/i+52mNChc0yjo6/jXpoAsN+V5rk2WU0NQRFX8RY+48z8kY4qWBHx2BeG1poDNHK K/xwWP38VggGm4bT8c6GbPVqQEGov8dERZjxti4jevPG5l3dDhxzlO5QuV9tWcKJYo ZC9huQ3TP9gplgB3P0TMLjTogFgeQKOxgo4E/PjbsPtu38ro5u6PfYzJvA7+vXzZ+0 xhz1vMusrIAxnD4UEQaLNFGsIVKMi1vSUOYnFXILQicFq7V0ZJnyhiBs1v52yDZt7V mdUXs2OqlgUpQ== Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-1fa0885e1c2so3186478fac.0; Wed, 29 Nov 2023 09:49:58 -0800 (PST) X-Gm-Message-State: AOJu0Yx7QVeVut9Q7yfnjijicfKXvqiypvOMzedrrYJznFq8/TgZ5YU2 mbkk4UEEicsIUvs4EzeABjNS0A2eh5zxkvpVA1M= X-Received: by 2002:a05:6870:82a5:b0:1fa:2888:701d with SMTP id q37-20020a05687082a500b001fa2888701dmr17426756oae.8.1701280197666; Wed, 29 Nov 2023 09:49:57 -0800 (PST) MIME-Version: 1.0 References: <20231122-dtc-warnings-v2-0-bd4087325392@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Thu, 30 Nov 2023 02:49:21 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 0/4] kbuild: Per arch/platform dtc warning levels To: Rob Herring Cc: Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Krzysztof Kozlowski , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Krzysztof Kozlowski , Alim Akhtar , Conor Dooley , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 29 Nov 2023 09:50:13 -0800 (PST) On Wed, Nov 29, 2023 at 7:25=E2=80=AFAM Rob Herring wrote= : > > On Tue, Nov 28, 2023 at 6:03=E2=80=AFAM Masahiro Yamada wrote: > > > > On Mon, Nov 27, 2023 at 11:03=E2=80=AFPM Rob Herring = wrote: > > > > > > On Thu, Nov 23, 2023 at 1:39=E2=80=AFAM Masahiro Yamada wrote: > > > > > > > > On Thu, Nov 23, 2023 at 7:12=E2=80=AFAM Rob Herring 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 overrid= e 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 s= amsung > > > > > patches can go via their normal trees. The added variable will ha= ve no > > > > > effect until merged with patch 2. > > > > > > > > > > v1: > > > > > - https://lore.kernel.org/all/20231116211739.3228239-1-robh@kern= el.org/ > > > > > > > > > > Signed-off-by: Rob Herring > > > > > --- > > > > > > > > > > > > There were some attempts in the past to enable W=3D1 in particular = subsystems, > > > > so here is a similar comment. > > > > > > > > Adding a new warning flag to W=3D1 is always safe without doing any= compile test. > > > > > > > > With this series, it would not be true any more because a new warni= ng in W=3D1 > > > > would potentially break riscv/samsung platforms. > > > > > > The difference here is the people potentially adding warnings are als= o > > > the ones ensuring no warnings. > > > > > > > Linus requires a clean build (i.e. zero warning) when W=3D option i= s not given. > > > > > > Linus doesn't build any of this AFAICT. We are not always warning fre= e > > > for W=3D0 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=3D1 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 :=3D \ + -Wavoid_unnecessary_addr_size \ + -Walias_paths \ + -Wgraph_child_address + dtb-$(CONFIG_ARCH_EXYNOS3) +=3D \ 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 +=3D -Wnode_name_chars_strict \ -Wunique_unit_address endif +# per-directory flags +DTC_FLAGS +=3D $(dtcflags) +# per-file flags DTC_FLAGS +=3D $(DTC_FLAGS_$(basetarget)) # Set -@ if the target is a base DTB that overlay is applied onto > > I understand your point on W=3D1 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=3D1. 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=3D1 > 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 =3D GZIP $@ > # ----------------------------------------------------------------------= ----- > DTC ?=3D $(objtree)/scripts/dtc/dtc > > +ifeq ($(findstring 1,$(KBUILD_EXTRA_WARN)),) > +DTC_FLAGS +=3D -Wno-some_new_warning_we_need_off_globally > +endif > + Hmm. Tricky, but works. KBUILD_EXTRA_WARN_DTC=3D1 is weaker than KBUILD_EXTRA_WARN=3D1 > KBUILD_EXTRA_WARN_DTC +=3D $(KBUILD_EXTRA_WARN) > > # Disable noisy checks by default > -- Best Regards Masahiro Yamada