Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp475786rwr; Wed, 26 Apr 2023 01:53:03 -0700 (PDT) X-Google-Smtp-Source: AKy350YooyeBKx5ZhyZGLiPqN7U/XSApbOFNdkIQAcaW2mqTiTtISeQIcn5djAjsJn23xY8/9nsE X-Received: by 2002:a05:6a20:9390:b0:f5:7e36:486d with SMTP id x16-20020a056a20939000b000f57e36486dmr11935936pzh.3.1682499183445; Wed, 26 Apr 2023 01:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682499183; cv=none; d=google.com; s=arc-20160816; b=SZr7PCQf0rVgZX7QM3doOqniOFEfKQ4KnqXmNJjFnxReEvXD20k0/ChzEVE2re7Xau 2kPbjYqb4jdVP+uivAuuEn+bNlfK/u+IyatDZCZFWz2unLegZDI1y76rkGNZkwXfWeYX Y7uA9w+OQshx5Bq6zHKDfMEYBhNoubZnKUg4JZB/Glq/uXdsU/WUa5l8fjvXsrtCKltR ROnvsrWyJ3roVEO3uPe1iJMkEdM+7VICFIqEnyIh6HeeOzm3yt1DAM6sVRfaFQu9sLid UOjhUH3Mqqb1R36GE/X/e6xa4ptCjBAwiXVjSJ0mw9Hl+CIFlya7iQ4vBGAEJOY18vbr DJ/A== 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; bh=bHUNZNctL5vT0l9ytRjMsiy6/oU1UpgFdCvDVQIhIPs=; b=BHtB51mSgYNFbyvT2vh5qsgkTlq9XWXsb/YMaCJ7Te1P0V7H1JLv9TiWJJ8uv1Z4t8 b5U7yqkcnJOa6/qZGPYVd2MZei5OxWqd/j0jxpPaaEPD8uuXHJK58h8mJforxEmaLLuO TLwFOeU1TfAWVeF/LvMNNum8aCgWjCCiE6nhFs8IFPmM+pM+wD1LZGw0eKoAqvJCKU4O LlIGgd70+fHFpfDXQImXv+cRNh+RWX+MOtVfhzvrLD7YSzp380IP7M5gowaYTNGWWt4M 7iATL+aRmku449SMBxYH9HkXZkSDtC1o68KfTtv694Q8mtkGJqk5oFWExrtMusPgAa4/ F9fw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a63cf17000000b0051384f6edf2si15009531pgg.640.2023.04.26.01.52.46; Wed, 26 Apr 2023 01:53:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239639AbjDZIpd (ORCPT + 99 others); Wed, 26 Apr 2023 04:45:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239752AbjDZIpc (ORCPT ); Wed, 26 Apr 2023 04:45:32 -0400 Received: from 167-179-156-38.a7b39c.syd.nbn.aussiebb.net (167-179-156-38.a7b39c.syd.nbn.aussiebb.net [167.179.156.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A8E52684 for ; Wed, 26 Apr 2023 01:45:25 -0700 (PDT) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1praly-002Vld-Vg; Wed, 26 Apr 2023 16:45:13 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Wed, 26 Apr 2023 16:45:12 +0800 Date: Wed, 26 Apr 2023 16:45:12 +0800 From: Herbert Xu To: Gaosheng Cui Cc: davem@davemloft.net, linux-crypto@vger.kernel.org Subject: Re: [PATCH -next] crypto: jitter - change module_init(jent_mod_init) to subsys_initcall(jent_mod_init) Message-ID: References: <20230425125709.39470-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230425125709.39470-1-cuigaosheng1@huawei.com> X-Spam-Status: No, score=2.7 required=5.0 tests=BAYES_00,HELO_DYNAMIC_IPADDR2, RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TVD_RCVD_IP,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Apr 25, 2023 at 08:57:09PM +0800, Gaosheng Cui wrote: > The ecdh-nist-p256 algorithm will depend on jitterentropy_rng, > and when they are built into kernel, the order of registration > should be done such that the underlying algorithms are ready > before the ones on top are registered. > > Now ecdh is initialized with subsys_initcall but jitterentropy_rng > is initialized with module_init. > > This patch will change module_init(jent_mod_init) to > subsys_initcall(jent_mod_init), so jitterentropy_rng will be > registered before ecdh-nist-p256 when they are built into kernel. > > Signed-off-by: Gaosheng Cui > --- > crypto/jitterentropy-kcapi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/crypto/jitterentropy-kcapi.c b/crypto/jitterentropy-kcapi.c > index b9edfaa51b27..563c1ea8c8fe 100644 > --- a/crypto/jitterentropy-kcapi.c > +++ b/crypto/jitterentropy-kcapi.c > @@ -205,7 +205,7 @@ static void __exit jent_mod_exit(void) > crypto_unregister_rng(&jent_alg); > } > > -module_init(jent_mod_init); > +subsys_initcall(jent_mod_init); This is unnecessary because we now postpone the testing of all algorithms until their first use. So unless something in the kernel makes use of this before/during module_init, then we don't need to move jent. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt