Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4344269pxf; Tue, 30 Mar 2021 05:46:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRvrhNgUEzPzTcRBNZQz0gq7JZ+uqc0MLLpJEtuKWfOgO29D1GbjbZxRB/rnwHCL5+oiQq X-Received: by 2002:a17:906:32da:: with SMTP id k26mr33102496ejk.483.1617108385898; Tue, 30 Mar 2021 05:46:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617108385; cv=none; d=google.com; s=arc-20160816; b=Z0bBV50GYCsSnZY/sRHsjtL1CPmFzoHYPlfAQg03xMtJGjA4z95Yd2EHjt7cfOq4/5 7hDvA06JeCDFsgEOR1Ox327kp0LqEF++61yvIFWnA5D1XPBIEFV5kGoo23glGfOIJOjV UDs/37Lxb0MQeLgQ5TrO+cfh/DaPaBgytVxBODD47qL6Q7pDQKUoYgTtEbkI1+X3CsM4 /2LTKzMfHLfVovbqCZ5pqTyahXniZzs95TmIi3xUlucymXUlt5ngepwODnviNTQ5L263 qGx2DG3Ly9Zh/jZYZEZq/Bp8O7t2NaJxGRHur+0pAZWx8YeHCqYK63AQkwxR6r0Ff3nN kNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=DV/y6Mc5fYUBtUPuVo+y2itUJJUPiJc8iiREGIN7oPY=; b=ML39xgQkXx0KgcyepJXbdrO59ZiQ6sNykt7M6USLu4Nv0apeRjfwhReaiwAofmNp3m MNbed2bmOA6KnbYVlgAhpYJ2CiNncInUtVCfdgPZEPT0AZ+797qY9EFVKYNCSffXas6G DCSv+zOVLP4P5Mt/07twelaBkv/zAYcLcr1VRhDSFYDy6M8+6BxNReGPxTR8AS4b6LMI Ev1EFuyetjbtd3ca8TcjYBvHG/J1e8i3MxOUEpEJHew6jmNpFOd6b37Mex0y2aneYJJ3 eeL0EZlxdcC+a1ofKERV6yq2l96/1DCfH0YolTwuB0yCo1Qk5i6aU5PiOp40gwtQzkJI vw4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bLHylBKg; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k1si14561520ejj.10.2021.03.30.05.46.01; Tue, 30 Mar 2021 05:46:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@linuxfoundation.org header.s=korg header.b=bLHylBKg; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbhC3MpZ (ORCPT + 99 others); Tue, 30 Mar 2021 08:45:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:45996 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232040AbhC3MpY (ORCPT ); Tue, 30 Mar 2021 08:45:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 32E9461957; Tue, 30 Mar 2021 12:45:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617108323; bh=CeJ4++sMVlMfilqcsFK96eYuyISeLwyu0ENP8ZyXN7c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bLHylBKg9SAq4TKe8FP5QoVt3kJaqkh88UdeafDlKovJ65J7fW/srg+XhWje0q+Ky qgTv38vNtFN6V1KHv9Tli1tfgRkXlQ352IxZzGEToLfF8UA3WbjjAFikZ40FPXrYiR G2QkvDht/t9pjuFDGt0h3t0UWvX/8y6FNDI+IBNg= Date: Tue, 30 Mar 2021 14:45:21 +0200 From: Greg KH To: tanghui20 Cc: herbert@gondor.apana.org.au, davem@davemloft.net, linux-crypto@vger.kernel.org, xuzaibo@huawei.com, wangzhou1@hisilicon.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] crypto: hisilicon - check if debugfs opened Message-ID: References: <1616833980-11006-1-git-send-email-tanghui20@huawei.com> <17d627e8-b89a-bbb8-f5d7-11210b859ac7@huawei.com> <4b3dc5bb-e6d0-4cfb-c3ca-d3b652879823@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4b3dc5bb-e6d0-4cfb-c3ca-d3b652879823@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Mar 30, 2021 at 08:40:07PM +0800, tanghui20 wrote: > > > On 2021/3/30 20:23, Greg KH wrote: > > On Tue, Mar 30, 2021 at 08:09:46PM +0800, tanghui20 wrote: > > > > > > > > > On 2021/3/28 23:09, Greg KH wrote: > > > > On Sat, Mar 27, 2021 at 04:33:00PM +0800, Hui Tang wrote: > > > > > 'xx_debugfs_init' check if debugfs opened. > > > > > > > > > > Signed-off-by: Hui Tang > > > > > --- > > > > > drivers/crypto/hisilicon/hpre/hpre_main.c | 5 ++++- > > > > > drivers/crypto/hisilicon/qm.c | 3 +++ > > > > > drivers/crypto/hisilicon/sec2/sec_main.c | 5 ++++- > > > > > drivers/crypto/hisilicon/zip/zip_main.c | 3 +++ > > > > > 4 files changed, 14 insertions(+), 2 deletions(-) > > > > > > > > > > diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c > > > > > index c7ab06d..f2605c4 100644 > > > > > --- a/drivers/crypto/hisilicon/hpre/hpre_main.c > > > > > +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c > > > > > @@ -779,6 +779,9 @@ static int hpre_debugfs_init(struct hisi_qm *qm) > > > > > struct device *dev = &qm->pdev->dev; > > > > > int ret; > > > > > > > > > > + if (!debugfs_initialized()) > > > > > + return -ENOENT; > > > > > > > > Why? What does this help with? Why does the code care if debugfs is > > > > running or not? > > > > > > > When !CONFIG_DEBUG_FS, there is no problem if debugfs is not checked, > > > but if checking debugfs, a series of stub functions of debugfs can be > > > skipped and 'xx_debugfs_init' will be return immediately. > > > > And have you measured an actual speed difference for that? I would be > > amazed if you could... > > > > I think what you said makes sense. > I am confused when to use 'debugfs_initialized'. Never, you should not care about that at all. thanks, greg k-h