Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4693207rwd; Tue, 30 May 2023 08:37:25 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7S//rom5spWbKa5sobblv2R6aI6YfF84X0zR2cqu3DJdM7ru5nGy6o43ezRhxjWN9NA1Pe X-Received: by 2002:a05:6a21:1647:b0:111:4371:4fe8 with SMTP id no7-20020a056a21164700b0011143714fe8mr2539673pzb.24.1685461045563; Tue, 30 May 2023 08:37:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1685461045; cv=pass; d=google.com; s=arc-20160816; b=CwycMVoBfftBghbToQf1CAeVW15N0pvmv9PSPkFgGhsfElI782hFnFFPWSrIoq7Oqa o7Udxqyn7/ET/MCIpSD0rCIWmazopSGS0Bye12kJtWUoO4zGehHO3A2W/lTpz6kBOh0P fuygTlS06SQ9UvgEFKftYocFSUFfNHJCscEMsSf92MNxenLWnffypyBJimXP21ad6/ls Ls9OlXrR01SQ0/He0zXeBSNBAYJFM62oB3btqa04xqwoHmCC74aQ+AuGAq5uIUIejVyT E8G2wxTR0LclCRXIeKslJZ7LNybDp6GZmMrbQ7i1h6qxxLusWg/3VFL+HalJXOFLRwOc vGlQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=3dnPSg5Ah7MshylwTE6osVTTdoL/t6YgZc39V9EvP3Q=; b=0U3AvU8/4ZShAwm1U+jeuuOZnYCjOlEBwByX7tWYk+xyaRZJ1nAOo7rp45UT7a1oPq uuVcj7vsz/WOpcIYH3CIs/l01NKe6xWK8u2i83TfX1KKtzprHG9qqU7GkiNoO5uQc/jV 58W3EunbSMLXi0sbGyURIh7ApQhIpfcM888szvrEEZqyQyg+IMWC8uwDyh0dwcgsp7q8 OLrBPJUW5ZgzfMUvFrKGvGO3aovgs865Ls28+Yf9zDzJe4+Kgay2kquXh9jgQFk9Qszx YkerWmuAw95+8ip2AcIfE1RBjbhFQ4dow5xBx3nh+WoVRecU3v3NS0pbDTyBVtppPYIE 2n6Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b="eSjdZo/X"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z135-20020a63338d000000b0052866b25be5si141673pgz.746.2023.05.30.08.37.13; Tue, 30 May 2023 08:37:25 -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=@amd.com header.s=selector1 header.b="eSjdZo/X"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230449AbjE3PZm (ORCPT + 99 others); Tue, 30 May 2023 11:25:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230471AbjE3PZh (ORCPT ); Tue, 30 May 2023 11:25:37 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2044.outbound.protection.outlook.com [40.107.92.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6DBDB0 for ; Tue, 30 May 2023 08:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C8lE+WUBhQxuWSWutqXnCQzC6rqhPTX4ZsZO01HNihUEMzZ3ow1yGr7ApkV5rKRdvLF3sDnGbZPvdcu+K2C3Ldxk7FWyCvAGml5LhPk1Yi0V5vhfJ6TpMJUBGRgeNPh5FydpL0f3J5D4Rp2nsoO/xS2C39arKG29fQARNxBJ3aJk2WB7ciwbbWYXKYD7YLOHF9Z+7qifIjLAy7mmrhBvT9VZlopdsXyiKhSpMET3mBpQmusTcBWrsPWFL8QKgrGpuH5jmHDVF3OUkBTsycjehvm6nZMGzuQG+1tSBPbGE5tIK1VrD3jZ38C8h/smTcpTGNRzLQCNQeUiv+io1Woy7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3dnPSg5Ah7MshylwTE6osVTTdoL/t6YgZc39V9EvP3Q=; b=c8GVpw3GrXtKBYoXsWvbUZpJlPYEwE7OuqugRHOD7GmUwID1s//z3AEP4iuowOkMUM+otqRV37nLnm6rHyqlpxRR6xg0z+/9quzpJTrVNKkUkn3nCOoW2m8CyRbjSVBPtc9H1D055zdWcsSdxTZT3zzqt8gwYF0Qis98yFCbH84tn58Q/w8ele0jv7zP/9UEVuXGzU7Xa0ruG+vjZ5zZG49TxUhq/WJuZJmpn5kchmUtPbDtPQls75/6ogIoJa0RAnR0CV13NjcxoGHqGHxMWoCpgyUxDskZLS7UAyCBWsG4HickLAmzizlFG8ZKVT3NDMqgFCK30Yg6k3ZMxYLhXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3dnPSg5Ah7MshylwTE6osVTTdoL/t6YgZc39V9EvP3Q=; b=eSjdZo/XTuN2iyVMy+twD+7ZpXFp/0go+XXQiCQbs/l8okS8r2Quz+52Lpb6tX3ngvdXeiW9YAyw5dcLx4leUfVJo/Ez+xeUyv3AgnD52TSq//4vpBgLPfn1T+mnJnbnDvk86m6rMGJUYOxXG1bwpJXSGY04NaV9H7OMvNBhjAk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from DM4PR12MB6280.namprd12.prod.outlook.com (2603:10b6:8:a2::11) by BN9PR12MB5366.namprd12.prod.outlook.com (2603:10b6:408:103::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.23; Tue, 30 May 2023 15:25:33 +0000 Received: from DM4PR12MB6280.namprd12.prod.outlook.com ([fe80::fe53:2742:10f9:b8f1]) by DM4PR12MB6280.namprd12.prod.outlook.com ([fe80::fe53:2742:10f9:b8f1%7]) with mapi id 15.20.6433.018; Tue, 30 May 2023 15:25:33 +0000 Message-ID: <85f47623-5ef1-b817-195b-c4ae39564247@amd.com> Date: Tue, 30 May 2023 11:24:55 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] drm/amd/amdgpu: introduce DRM_AMDGPU_WERROR Content-Language: en-US To: amd-gfx@lists.freedesktop.org Cc: Alex Deucher , Kenny Ho , Jani Nikula , =?UTF-8?Q?Christian_K=c3=b6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , Felix Kuehling , Harry Wentland , =?UTF-8?Q?Andr=c3=a9_Almeida?= , Andrew Davis , Peter Foley , Hawking Zhang , Le Ma , Tao Zhou , Lijo Lazar , James Zhu , YiPeng Chai , Candice Li , Yang Wang , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20230525163827.548058-1-hamza.mahfooz@amd.com> From: Hamza Mahfooz In-Reply-To: <20230525163827.548058-1-hamza.mahfooz@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: YQBPR0101CA0263.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c01:68::17) To DM4PR12MB6280.namprd12.prod.outlook.com (2603:10b6:8:a2::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR12MB6280:EE_|BN9PR12MB5366:EE_ X-MS-Office365-Filtering-Correlation-Id: 3fb5fb18-42a4-49ef-a737-08db61221c14 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LH8Y+XBoFEL4UNYAANGBLkMguSJdvcCMaUAUCMqoIQlYmqGQni7T7ezjwPnZtx75xjPGqdkveMbVsFigrYr9Kn30wtJdq4oZUhuAWYDynn9wRfZRNsa51P+lQ5T2im1Jtcm3mWmt/nOhFiw+rG8spC1OgIvydMk558bgcaI9K+ZzVmrIgGqvbiJ2EA7U16T8D4r8UcQ/3vnFSU32iViIWZm9nFMoC1TjbOMqyFd1A8pt4lEXO9OHvAHvJqR1vYsowOHXTcOhCLcpR2SmMzCOydRdyjVCVROAH/nAP7buHNOcsydG0t5T/2710lBvsW3Txnw5t4FArvdYUcjUOYqrcn2aQHbvOgAsXyehaV3H4IMfMZoxExmjbOGFgb8YdvASVQQCFezQt6I/xkPaE6fp9VUA0nQYIVIh/jf95jDUYIo8ahNzi6ubmcfmRxvDYxTweeqXCyLRIk3O8WF7ZMUHZKUFRlsuqSiLl6/i1J8SJC/51+C08fKY0LlaZ6C8iQYmIF7thQ3ZA6x33tu6czFQYbt49O5F9ahPGbvMhuqQLOh8uRbwjxW6OUNtZobG0v7bH6FY+bAjux7OJwwDbSqancVzHV/UJXQMI6i0Lr9wK5Z30K48KoPozV6on1pHJVpAHSzM4BczsgWzlsI1nUdnCQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR12MB6280.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(346002)(39860400002)(136003)(376002)(396003)(366004)(451199021)(66946007)(4326008)(6916009)(36756003)(66556008)(66476007)(83380400001)(5660300002)(44832011)(31696002)(86362001)(38100700002)(41300700001)(186003)(2616005)(8936002)(8676002)(6486002)(2906002)(31686004)(6666004)(6512007)(6506007)(316002)(26005)(53546011)(478600001)(54906003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q1Y5TUhuZTVMcEdJaFI4ZVB3b0VPZFJiRS9ud0JMOGFmbVJYYTRTTXFuL2xR?= =?utf-8?B?cFpQZUM3TkR4YmwrejZXY2pyNFJrUDkzMWJpOVluSHF3OTBSczZMYmdDSC9I?= =?utf-8?B?YlZCaHFEZVRSVkhVaisrZTNjMFVNQnhVOFNXNGZqL3hsbm4vR3FwSXBjZUxR?= =?utf-8?B?R1Z5L0ZuVUN2M0IrQW9iZEdVRVh2ekN6dUhuNVRjQU9ZWDNjNmhvZXdVejJG?= =?utf-8?B?M0lPOEhhNmNoUitJK3JiRUEzVHhoenFzNE15OW9wMXlySmFCejFPRFFyc1g4?= =?utf-8?B?MzA1akVyZTFnK0lIOXB2SWlSWnFSdmRrbWVnQ3FpSWlFWjYrQVdweXplYWVB?= =?utf-8?B?Q3FwbmZ1bCtlVDMzRW1qd0M5RjBiVFB3Y09odVVaRWsvK21GU2x2V0F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 X-MS-Exchange-CrossTenant-AuthSource: DM4PR12MB6280.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 May 2023 15:25:33.3535 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: yhFfc9Jge6NZT+a0IDjKQbsSkHwMqzCf8u/yk2zWXZNVW9rkzUiYMQE7/Kl8m4dQOp+voD2HoAUhjWeuwEO8kg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5366 X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 5/25/23 12:38, Hamza Mahfooz wrote: > We want to do -Werror builds on our CI. However, non-amdgpu breakages > have prevented us from doing so thus far. Also, there are a number of > additional checks that we should enable, that the community cares about > and are hidden behind -Wextra. So, define DRM_AMDGPU_WERROR to only > enable -Werror for the amdgpu kernel module and enable -Wextra while > disabling all of the checks that are too noisy. > > Cc: Alex Deucher > Cc: Kenny Ho > Suggested-by: Jani Nikula > Signed-off-by: Hamza Mahfooz I am able to get clean builds with this enabled on GCC 11-13 and Clang 15, at least as of commit e786aef0869c ("drm/amd/display: remove unused definition") on amd-staging-drm-next. > --- > drivers/gpu/drm/amd/amdgpu/Kconfig | 10 ++++++++++ > drivers/gpu/drm/amd/amdgpu/Makefile | 9 +++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/Kconfig b/drivers/gpu/drm/amd/amdgpu/Kconfig > index 07135ffa6d24..334511f331e3 100644 > --- a/drivers/gpu/drm/amd/amdgpu/Kconfig > +++ b/drivers/gpu/drm/amd/amdgpu/Kconfig > @@ -66,6 +66,16 @@ config DRM_AMDGPU_USERPTR > This option selects CONFIG_HMM and CONFIG_HMM_MIRROR if it > isn't already selected to enabled full userptr support. > > +config DRM_AMDGPU_WERROR > + bool "Force the compiler to throw an error instead of a warning when compiling" > + depends on DRM_AMDGPU > + depends on EXPERT > + depends on !COMPILE_TEST > + default n > + help > + Add -Werror to the build flags for amdgpu.ko. > + Only enable this if you are warning code for amdgpu.ko. > + > source "drivers/gpu/drm/amd/acp/Kconfig" > source "drivers/gpu/drm/amd/display/Kconfig" > source "drivers/gpu/drm/amd/amdkfd/Kconfig" > diff --git a/drivers/gpu/drm/amd/amdgpu/Makefile b/drivers/gpu/drm/amd/amdgpu/Makefile > index 74a9aa6fe18c..7ee68b1bbfed 100644 > --- a/drivers/gpu/drm/amd/amdgpu/Makefile > +++ b/drivers/gpu/drm/amd/amdgpu/Makefile > @@ -39,6 +39,15 @@ ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \ > -I$(FULL_AMD_DISPLAY_PATH)/amdgpu_dm \ > -I$(FULL_AMD_PATH)/amdkfd > > +subdir-ccflags-y := -Wextra > +subdir-ccflags-y += -Wunused-but-set-variable > +subdir-ccflags-y += -Wno-unused-parameter > +subdir-ccflags-y += -Wno-type-limits > +subdir-ccflags-y += -Wno-sign-compare > +subdir-ccflags-y += -Wno-missing-field-initializers > +subdir-ccflags-y += -Wno-override-init > +subdir-ccflags-$(CONFIG_DRM_AMDGPU_WERROR) += -Werror > + > amdgpu-y := amdgpu_drv.o > > # add KMS driver -- Hamza