Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3066445rwd; Sat, 10 Jun 2023 00:28:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5EKnQSUv3qomjiUJc8s+FwindSahetW04hMqJPPID80viCjbWKXZUEdDR3Tv0ITx8PLfvT X-Received: by 2002:a05:6a00:228b:b0:656:8e21:bd37 with SMTP id f11-20020a056a00228b00b006568e21bd37mr3338581pfe.21.1686382100869; Sat, 10 Jun 2023 00:28:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686382100; cv=none; d=google.com; s=arc-20160816; b=bj1Z1g1Utf4yBJhq7mb8AV670oz5gYuBA8oJKQvIhHnitmijONPWdEQAOm2C5cFZrQ 9S1bmjlm/lCD1da/WI70lvbkhuHorfbUju8YylgfAMMcYioer6PqOV5/nFHPiGMGZxak koBug6tS4xqqH/Lo6YY2hDI5Z7WPooLCWq8Reg4GoPQFTsVZ2A5JN3hfFzcoNaDw5lNZ kZ4Bl0hqXDVeAMVNRUnP5pQStuxjmaqSz6XPnWJMRWh8ZuvUWqyiXZkRfmlOlZZ2umdX k4ZwepxxsM3zHOdKXzY4n7xI2/ELSHwVhP78/gNizc0r5TI2htpdikjRuOzTZXfU2MGg gwYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=9E/F1i52gdMH7hFf4k/yqB/6NI+blg7jJP7Fvkg5bP4=; b=u68aEicYzEd3ug70gg/MBsy4MJe3I8WTJ9N59+e/rqGPRSzLJGAwAvEowkEzJslbdV k4GOMaRG+uy2yzfAx2Acu8Lhl281ywzNEsVWWBukGQTph8dW3npPb5EQjdVh7LVZZ6TN DLpXx/eBpTDWdpIKE4CsAEZW+yQJXjYctjErpMQy5XV4ilaMnQxTA5GbpAOg4CC53ib0 pt3sGZlNLwt2cWatZvw2m3NObPPy6dL5oOhYwTp9Rxw8dcSjdLM+UHzOCJ5K6XgeHh2/ PsHrsP6Mi56hQ0jaoa/CcwskyQG3AEWvMGWZH6/fk/ol3hVyfwDrKkcIJyYbnAgN0v6W swOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GE5xsn8m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g197-20020a6252ce000000b006610cb64216si3678457pfb.13.2023.06.10.00.28.08; Sat, 10 Jun 2023 00:28:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GE5xsn8m; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231981AbjFJGtq (ORCPT + 99 others); Sat, 10 Jun 2023 02:49:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbjFJGtn (ORCPT ); Sat, 10 Jun 2023 02:49:43 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72EAD3A8D; Fri, 9 Jun 2023 23:49:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686379781; x=1717915781; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=UiBaKKuIu48RRz7kin0VOWL4SjKi6DsOcDmvTbBe48o=; b=GE5xsn8mMwhzkAcFerl9x7GXUERULvHJazT6PubSlF3LpV3RjvF0QHWJ Ma6YG308e0EdyupMJcYuysosj1g+5hx78RmsIuSkbKfL1zzrhbzi1oHPJ h2GSvyKCRyuESotwpzWZxpxxdoRWtmD0JRxkACsj5P02ijpIwxwHUqCXO 5y0paXnufyDhg75xjNQcs40u0GHIRgf55oA8kxXnjFkfMb0giEjy4r9/z RfMbzyq0COBMl+WIcLr0jgEuDLsqRe6zh7S9skOqJ8HZN9qVzcn4qMs/r 40JYSF61zNAcM98az+lBy/3qNZjTbuQHq3S3CCehKpFhZDney6Z4DnqKG w==; X-IronPort-AV: E=McAfee;i="6600,9927,10736"; a="360220140" X-IronPort-AV: E=Sophos;i="6.00,231,1681196400"; d="scan'208";a="360220140" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 23:49:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10736"; a="661001719" X-IronPort-AV: E=Sophos;i="6.00,231,1681196400"; d="scan'208";a="661001719" Received: from mnovakov-mobl1.amr.corp.intel.com (HELO localhost) ([10.252.60.33]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2023 23:49:34 -0700 From: Jani Nikula To: Masahiro Yamada , Nathan Chancellor Cc: Tao Zhou , Xiaojian Du , linux-kbuild@vger.kernel.org, dri-devel@lists.freedesktop.org, "Pan, Xinhui" , linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, Lijo Lazar , Le Ma , YiPeng Chai , Hamza Mahfooz , Alex Deucher , James Zhu , Christian =?utf-8?Q?K=C3=B6nig?= , Hawking Zhang Subject: Re: [PATCH] drm/amd/amdgpu: enable W=1 for amdgpu In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20230609164207.430377-1-hamza.mahfooz@amd.com> <20230609201754.GA3961359@dev-arch.thelio-3990X> Date: Sat, 10 Jun 2023 09:49:31 +0300 Message-ID: <875y7vrev8.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 10 Jun 2023, Masahiro Yamada wrote: > On Sat, Jun 10, 2023 at 5:17=E2=80=AFAM Nathan Chancellor wrote: >> >> + Masahiro and linux-kbuild >> >> On Fri, Jun 09, 2023 at 12:42:06PM -0400, Hamza Mahfooz wrote: >> > We have a clean build with W=3D1 as of >> > commit 12a15dd589ac ("drm/amd/display/amdgpu_dm/amdgpu_dm_helpers: Move >> > SYNAPTICS_DEVICE_ID into CONFIG_DRM_AMD_DC_DCN ifdef"). So, let's enab= le >> > these checks unconditionally for the entire module to catch these erro= rs >> > during development. >> > >> > Cc: Alex Deucher >> > Cc: Nathan Chancellor >> > Signed-off-by: Hamza Mahfooz >> >> I think this is fine, especially since it will help catch issues in >> amdgpu quickly and hopefully encourage developers to fix their problems >> before they make it to a tree with wider impact lika -next. >> >> However, this is now the third place that W=3D1 has been effectively >> enabled (i915 and btrfs are the other two I know of) and it would be >> nice if this was a little more unified, especially since it is not >> uncommon for the warnings under W=3D1 to shift around and keeping them >> unified will make maintainence over the longer term a little easier. I >> am not sure if this has been brought up in the past and I don't want to >> hold up this change but I suspect this sentiment of wanting to enable >> W=3D1 on a per-subsystem basis is going to continue to grow. > > > > I believe this patch is the right way because > we will be able to add a new warning option to > scripts/Makefile.extrawarn without fixing any code. > > I remember somebody argued that drivers should be > able to do > subdir-ccflags-y +=3D $(W1_FLAGS) Personally, I think this would be the viable way to make the kernel free of W=3D1 warnings. Make it clean driver and subsystem at a time, with constant progress. Currently, there's haphazard fixing of issues, with new ones creeping back in, because kernel-wide W=3D1 is too verbose for most developers. It's whac-a-mole. > However, if a new flag, -Wfoo, emits warnings > for drivers/gpu/drm/{i915,amd}, > you cannot add it to W=3D1 until fixing the code. Or adding -Wno-foo where it breaks, until fixed. > If many drivers start to do likewise, > W=3D1 warning will not be W=3D1 any more. I don't know, is the goal to fix the warnings, or keep adding stuff to W=3D1 so that it'll always emit warnings? :p BR, Jani. > Another good thing for hard-coding warning options > is you can lift up a warning flag one by one. > > > Let's say you fixed the entire DRM subsystem so > it is -Wunused free now. > > Then, you can move -Wunused to drivers/gpu/drm/Makefile, > while other warning options stay in drivers Makefiles. > > > > > > > >> >> Regardless, for clang 11.1.0 to 16.0.5, I see no warnings when building >> drivers/gpu/drm/amd/amdgpu/ with Arch Linux's configuration or >> allmodconfig. >> >> Reviewed-by: Nathan Chancellor >> Tested-by: Nathan Chancellor >> >> > --- >> > drivers/gpu/drm/amd/amdgpu/Makefile | 13 ++++++++++++- >> > 1 file changed, 12 insertions(+), 1 deletion(-) >> > >> > diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd= /amdgpu/Makefile >> > index 86b833085f19..8d16f280b695 100644 >> > --- a/drivers/gpu/drm/amd/amdgpu/Makefile >> > +++ b/drivers/gpu/drm/amd/amdgpu/Makefile >> > @@ -40,7 +40,18 @@ ccflags-y :=3D -I$(FULL_AMD_PATH)/include/asic_reg \ >> > -I$(FULL_AMD_PATH)/amdkfd >> > >> > subdir-ccflags-y :=3D -Wextra >> > -subdir-ccflags-y +=3D $(call cc-option, -Wunused-but-set-variable) >> > +subdir-ccflags-y +=3D -Wunused >> > +subdir-ccflags-y +=3D -Wmissing-prototypes >> > +subdir-ccflags-y +=3D -Wmissing-declarations >> > +subdir-ccflags-y +=3D -Wmissing-include-dirs >> > +subdir-ccflags-y +=3D -Wold-style-definition >> > +subdir-ccflags-y +=3D -Wmissing-format-attribute >> > +# Need this to avoid recursive variable evaluation issues >> > +cond-flags :=3D $(call cc-option, -Wunused-but-set-variable) \ >> > + $(call cc-option, -Wunused-const-variable) \ >> > + $(call cc-option, -Wstringop-truncation) \ >> > + $(call cc-option, -Wpacked-not-aligned) >> > +subdir-ccflags-y +=3D $(cond-flags) >> > subdir-ccflags-y +=3D -Wno-unused-parameter >> > subdir-ccflags-y +=3D -Wno-type-limits >> > subdir-ccflags-y +=3D -Wno-sign-compare >> > -- >> > 2.40.1 >> > --=20 Jani Nikula, Intel Open Source Graphics Center