Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp684659pxu; Fri, 4 Dec 2020 12:54:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJz6qiIRRZWVGZDRseykBAR9KQwvBcsTCdq9kvDoYUvfEudjKYg93YojwejwdaaE/72bKQH4 X-Received: by 2002:a05:6402:388:: with SMTP id o8mr9124207edv.359.1607115260605; Fri, 04 Dec 2020 12:54:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607115260; cv=none; d=google.com; s=arc-20160816; b=n+y/NYFFHUPdQjd9196zqIpq+UQRhz62uf2oOjl+RQ9iwjKiaIza276mlx8kbq25Vj jVkMi/WPI92/XAfpQNNmQb4F+7DqFLpGpRABsUAXVweyfpgEn959Ppwgk5cwZluvTa3n OPLsrxEdUl8BUqxXwEAuRsg+nfO3YT+u5juGrh289JdvLLic7F2Vx2lN8a5rSvlUJstc KamIqdhH4KD2194NtouklW2MnmXtttyPDe4ebCZtO7qeWTeEXq5bj8IiBfeGeoGpLflo xAUGEMVmhyDbeVl7TWg6QumfknP/FnX0IuCIfpmmwU7OAaaGOnQCQ0mbsTJUULRJGC+u W13w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ETBT8tLrqWhU3nQJzSd6pnShSvogFC7sNASc+9sqs84=; b=wiCJdubyzro68J9ER4ASXfQcVraq20XWC8XmFqH5pH0z2Wv7kvDxwkfpBAn4gD9l/K fR4wmhKztacOZ3VDPWd7Y3wGhKvPQRPwaeW4McM0axz+1y3FgaZZDezPdX++W41Kv77j 21Z/0P5knXpvaM9n6AI7QzN2/Khss77VlG5kT570PrnGcf+uCNnywmCyx7kNAico9GBQ p1XbtK+FOsQDcUBPh4MHfcm20vFEXSnQWfnER+JMUU9YDSB4AYk8kKELwA4SP7JQPieY Y6+d7NsxMIWNkf74og87JVz8dcBWblzosYIffMHU1xDet96eMwWS/P7XW37SMMLHAtzp to/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X+FBgvPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r12si1605522edw.349.2020.12.04.12.53.57; Fri, 04 Dec 2020 12:54:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=X+FBgvPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387468AbgLDUtu (ORCPT + 99 others); Fri, 4 Dec 2020 15:49:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730241AbgLDUtu (ORCPT ); Fri, 4 Dec 2020 15:49:50 -0500 Received: from mail-ot1-x342.google.com (mail-ot1-x342.google.com [IPv6:2607:f8b0:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF945C061A4F for ; Fri, 4 Dec 2020 12:49:01 -0800 (PST) Received: by mail-ot1-x342.google.com with SMTP id h18so2538616otq.12 for ; Fri, 04 Dec 2020 12:49:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ETBT8tLrqWhU3nQJzSd6pnShSvogFC7sNASc+9sqs84=; b=X+FBgvPnntPzx4qoAbpgm6nFj7+d26T0HuVa/rSpQ3DzJFvuqolcnpaLkYRm79Q8+M XeLX4Tx6t+uTQGlrNgSe2lHw4cqJWCV/Vt+OVDN+QAKXVg3bz3d1QV2OJcHbgaZfHcn5 OodPePv4psMzAqlr39L1ykKMfWMeVWe0Xp/plL040gAMHCKYHpOSmBJXewtTcNOKX9Wy TAsznwK1xKd7zA3QcQNSYYJlP0mW2yEQ8hToZUjghT42SleNCa+E3rHe85lwc58XZmgl WiJEomjQze0QEXjx09VcEIVmbnXOthYItD3khx/jdY2QDY2OA+QP7hRJRnO3XtWhn50g XSgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ETBT8tLrqWhU3nQJzSd6pnShSvogFC7sNASc+9sqs84=; b=fe+q/oKNaCtedSCAyZlLm2FyulniqUbGNYcFNAAd4/0i80+Lz6sw6PMAhpflYsf9pf L3cesLdkZPEwocVs+yykHQdfTpMvawVdgIoG/3HebsnVQFITlbjeaWgYcDmJs9mDqd/W 1QxUVTNAWmjnITAFevWwgsGOXofBaWQZp4E56bxaUAheB8d0rGg9IcEncJN3nEuridxY psho2Xkgpq57m3BXdsxV5z5jjFxxV3aXLqsBVq8kjbKocONl0YBUThKOQF8+CCHhXV4A LWry7nWL9IkM78Ms+Ca2nSW8gbupYNjeit4EwSJvhMYAdU3Hh05iqhOVt6s2DgYqKzCl UUHg== X-Gm-Message-State: AOAM533RVOJeWJwMXUV1+ytf5Lpz+V7PqtLumtCzIy6gAqaAj+TttxOm o465KeGuoKYXWbhjboxDwtgAK85mS4qr4EJJlcs= X-Received: by 2002:a05:6830:1b7b:: with SMTP id d27mr2649539ote.132.1607114941003; Fri, 04 Dec 2020 12:49:01 -0800 (PST) MIME-Version: 1.0 References: <20201203230652.1480863-1-arnd@kernel.org> In-Reply-To: From: Alex Deucher Date: Fri, 4 Dec 2020 15:48:49 -0500 Message-ID: Subject: Re: [PATCH] drm/amdgpu: fix debugfs creation/removal, again To: "Zhou1, Tao" Cc: Arnd Bergmann , "Deucher, Alexander" , "Koenig, Christian" , David Airlie , Daniel Vetter , "Li, Dennis" , "Chen, Guchun" , Arnd Bergmann , "linux-kernel@vger.kernel.org" , "amd-gfx@lists.freedesktop.org" , "Ma, Le" , "Yang, Stanley" , "dri-devel@lists.freedesktop.org" , "Clements, John" , "Zhang, Hawking" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 4, 2020 at 1:17 AM Zhou1, Tao wrote: > > [AMD Public Use] > > Reviewed-by: Tao Zhou Applied. Thanks! Alex > > > -----Original Message----- > > From: Arnd Bergmann > > Sent: Friday, December 4, 2020 7:07 AM > > To: Deucher, Alexander ; Koenig, Christian > > ; David Airlie ; Daniel Vetter > > ; Li, Dennis ; Zhou1, Tao > > ; Chen, Guchun > > Cc: Arnd Bergmann ; Zhang, Hawking > > ; Clements, John ; > > Yang, Stanley ; Ma, Le ; amd- > > gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux- > > kernel@vger.kernel.org > > Subject: [PATCH] drm/amdgpu: fix debugfs creation/removal, again > > > > From: Arnd Bergmann > > > > There is still a warning when CONFIG_DEBUG_FS is disabled: > > > > drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c:1145:13: error: > > 'amdgpu_ras_debugfs_create_ctrl_node' defined but not used [- > > Werror=unused-function] > > 1145 | static void amdgpu_ras_debugfs_create_ctrl_node(struct > > amdgpu_device *adev) > > > > Change the code again to make the compiler actually drop this code but not > > warn about it. > > > > Fixes: ae2bf61ff39e ("drm/amdgpu: guard ras debugfs creation/removal based > > on CONFIG_DEBUG_FS") > > Signed-off-by: Arnd Bergmann > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 13 +++++-------- > > drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 6 ------ > > 2 files changed, 5 insertions(+), 14 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > > index 9d11b847e6ef..c136bd449744 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c > > @@ -1167,7 +1167,7 @@ static void > > amdgpu_ras_debugfs_create_ctrl_node(struct amdgpu_device *adev) > > con->dir, &con->disable_ras_err_cnt_harvest); > > } > > > > -void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, > > +static void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, > > struct ras_fs_if *head) > > { > > struct amdgpu_ras *con = amdgpu_ras_get_context(adev); @@ -1189,7 > > +1189,6 @@ void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, > > > > void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev) { -#if > > defined(CONFIG_DEBUG_FS) > > struct amdgpu_ras *con = amdgpu_ras_get_context(adev); > > struct ras_manager *obj; > > struct ras_fs_if fs_info; > > @@ -1198,7 +1197,7 @@ void amdgpu_ras_debugfs_create_all(struct > > amdgpu_device *adev) > > * it won't be called in resume path, no need to check > > * suspend and gpu reset status > > */ > > - if (!con) > > + if (!IS_ENABLED(CONFIG_DEBUG_FS) || !con) > > return; > > > > amdgpu_ras_debugfs_create_ctrl_node(adev); > > @@ -1212,10 +1211,9 @@ void amdgpu_ras_debugfs_create_all(struct > > amdgpu_device *adev) > > amdgpu_ras_debugfs_create(adev, &fs_info); > > } > > } > > -#endif > > } > > > > -void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev, > > +static void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev, > > struct ras_common_if *head) > > { > > struct ras_manager *obj = amdgpu_ras_find_obj(adev, head); @@ - > > 1229,7 +1227,6 @@ void amdgpu_ras_debugfs_remove(struct amdgpu_device > > *adev, > > > > static void amdgpu_ras_debugfs_remove_all(struct amdgpu_device *adev) { - > > #if defined(CONFIG_DEBUG_FS) > > struct amdgpu_ras *con = amdgpu_ras_get_context(adev); > > struct ras_manager *obj, *tmp; > > > > @@ -1238,7 +1235,6 @@ static void amdgpu_ras_debugfs_remove_all(struct > > amdgpu_device *adev) > > } > > > > con->dir = NULL; > > -#endif > > } > > /* debugfs end */ > > > > @@ -1286,7 +1282,8 @@ static int amdgpu_ras_fs_init(struct amdgpu_device > > *adev) > > > > static int amdgpu_ras_fs_fini(struct amdgpu_device *adev) { > > - amdgpu_ras_debugfs_remove_all(adev); > > + if (IS_ENABLED(CONFIG_DEBUG_FS)) > > + amdgpu_ras_debugfs_remove_all(adev); > > amdgpu_ras_sysfs_remove_all(adev); > > return 0; > > } > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h > > index 4667cce38582..762f5e46c007 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h > > @@ -592,14 +592,8 @@ int amdgpu_ras_sysfs_create(struct amdgpu_device > > *adev, int amdgpu_ras_sysfs_remove(struct amdgpu_device *adev, > > struct ras_common_if *head); > > > > -void amdgpu_ras_debugfs_create(struct amdgpu_device *adev, > > - struct ras_fs_if *head); > > - > > void amdgpu_ras_debugfs_create_all(struct amdgpu_device *adev); > > > > -void amdgpu_ras_debugfs_remove(struct amdgpu_device *adev, > > - struct ras_common_if *head); > > - > > int amdgpu_ras_error_query(struct amdgpu_device *adev, > > struct ras_query_if *info); > > > > -- > > 2.27.0 > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel