Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp991239iob; Fri, 13 May 2022 18:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJiO3zO8nWlxSEOslnDMYj1biPCwHteC6FbHvnGHvIYISS441oA19Gb/yqAOBcjCgjENX7 X-Received: by 2002:a05:600c:3d8c:b0:394:6097:9994 with SMTP id bi12-20020a05600c3d8c00b0039460979994mr17260093wmb.29.1652493058513; Fri, 13 May 2022 18:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652493058; cv=none; d=google.com; s=arc-20160816; b=bbKaWQ9/7P8/0qkbKFY0PeZcLDuizpXbLtUkB2KOFEdwSgmoa9+edHh3BEvnSz2Yn8 mKhCgQMeSWFRgi+7oyuT4ZbAi+N4lPsXohAeoTj12qWekJHp4PmA+hxeZ3LPJUJLJ+20 c0tTUmsKAlNjpdphtntljg1yS4xN+OXZxS1SgTxWGxH+yBGvLksh+7m4ql0mXKtK2rKD ZVJKi1TNPp5ebMuit+AJvNEuTxebdviMCPdZE9IY5Qut1Ym3JQwU8bx5q9HOZpX0eEj9 zrog8d/APSPcbPJ/JYwHlLQ396/j2kXmERV/V6dIldIovgV+a1zUMOY0crpKn1Xq8ltt rkSw== 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=o0kVmjdcMUKYVM5DrVqgurkhzcUKhblSSgNmYbuiRRg=; b=o9ZszUiMg672/pTW3hUel5kdqMFsH8kCqpDBmeqiX3WH2pKcxV49iFbOQSd+eU0BQ1 6B3N3yvDBbWSIUF4VKt0ae0iJiHXBNtV1BI2CKlnG7q9WAFyloVgOFzUOlTtz0Ovzi3y FCtvvbUQrs2WZXjHmHgPby8uoOwbOoIGo/k5S7YMZSTYC70x7fUfe93ioYVl6iBeTWuN kG3+MPiw4v0vHRMkNuNQ/bJ4JPWL4YY6zgyUoecNUpeTH9hyEuwTiqOkVEmrzeeT4weV AHEuwTyS75zgSDBdjxtf2bl07xxUfQtjj+u8xmyHm0Qza/hjOnYTPmRpWsvMpgCMT0GJ STUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CcTeCWOY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p20-20020a05600c359400b003941b5b62d9si8135454wmq.211.2022.05.13.18.50.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 18:50:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CcTeCWOY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EFFE744A029; Fri, 13 May 2022 17:14:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1384642AbiEMVS0 (ORCPT + 99 others); Fri, 13 May 2022 17:18:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240772AbiEMVSY (ORCPT ); Fri, 13 May 2022 17:18:24 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1792B522E5 for ; Fri, 13 May 2022 14:18:23 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id x18so9107158plg.6 for ; Fri, 13 May 2022 14:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=o0kVmjdcMUKYVM5DrVqgurkhzcUKhblSSgNmYbuiRRg=; b=CcTeCWOYH5IP5w44cu7dNo2TnZ/9Jx/DeJm8b0kUpZgsy3l9UnRTVQ62bBl7e+LpPY uTdOP+qtH8CxKFdV2hEA9fdjzPRETXryPhxAhm2mbvT25s0H8e5hfRE9HbHgjjFvBC1e 3BemwWOw7u583NKe+1Yuls4TqwcQRtR0N9ZLSR/motIt3kq9nTk4lxphNAvqQkzq43aw HhEA8WBEupPU7Uu95wWDZaGYEYzVGLa/9rBljxZ6OaVeYVZsD9/dsJHcR949/J/TWQTE eAdD0/JMKMNyAUIfnZ0iKXk3F4e/fiGixPeE9DWiMjcAxji6GevP3vM2aTiyzhHwPM9K bVfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=o0kVmjdcMUKYVM5DrVqgurkhzcUKhblSSgNmYbuiRRg=; b=xQHfSbBCcKHZcKHSbYjPotzLMTU2iMUDCW8L8EDURtFuqfnIv9WiIgw6op10slYsIb Vyx0mgmUeNEUt2CMVPPzEmZpaqzL7NMVDltYwxws/oqNxdvDhd3E1zCDutnRemaSXCQ4 K/N2D5FxpCLJYpMH73gaFXDAq7DHU0HywiO7cQwCTuf43wZ/0Bel4qIwSi8SN0Uw+on9 3ICcqJ2CKi4o5GUBbjdBfBl0joIE34KN7BUlWNNTxSMxBdr1k9uZCEY+FRolBnV5iU7E MyTUbizGBbo97o5PsuHrUUAn9Pmw78oMNpnw/18AQHnY4ANPuGwNWtQU9B4Iac1KxRtF 85hw== X-Gm-Message-State: AOAM531evYVrnaoldloXjZ9cspkp3MBMPsQ4vNf80gtUIsSyRTbpzfRo CO70BmGLV3AMGp6Ko8XzF/Lxcl0UFpA= X-Received: by 2002:a17:90b:1291:b0:1db:eab7:f165 with SMTP id fw17-20020a17090b129100b001dbeab7f165mr18071902pjb.74.1652476702383; Fri, 13 May 2022 14:18:22 -0700 (PDT) Received: from localhost ([2409:10:24a0:4700:e8ad:216a:2a9d:6d0c]) by smtp.gmail.com with ESMTPSA id v8-20020a1709028d8800b0015e8d4eb1f3sm2304845plo.61.2022.05.13.14.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 14:18:21 -0700 (PDT) Date: Sat, 14 May 2022 06:18:19 +0900 From: Stafford Horne To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [PATCH] init: call time_init() before rand_initialize() Message-ID: References: <20220505003114.177552-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220505003114.177552-1-Jason@zx2c4.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Thu, May 05, 2022 at 02:31:14AM +0200, Jason A. Donenfeld wrote: > Currently time_init() is called before rand_initialize(), but > rand_initialize() makes use of the timer on various platforms, and > sometimes this timer needs to be initialized by time_init() first. In > order to not return zero, reverse the order of these two calls. The > block doing random initialization was right before time_init() before, > so changing the order shouldn't have any complicated effects. > > Cc: Stafford Horne > Cc: Andrew Morton > Signed-off-by: Jason A. Donenfeld I was thinking along the same lines when I looked into the OpenRISC issue that we fixed discussed here: - https://lore.kernel.org/all/Ym27sFdFZEt5QV0i@antec/ Though, I was not sure as to any dependency issues caused by changing the order. Having it in -next and testing for a while should be able to bring out any bug. As for this patch: Reviewed-by: Stafford Horne > --- > Andrew - this file has no formal maintainer, but you've signed the most > commits, so I'm CC'ing you. This has some interactions with my > random.git tree, so unless there are objections, I'll queue it up there. > -Jason > > init/main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/init/main.c b/init/main.c > index 98182c3c2c4b..e37ec99cf56d 100644 > --- a/init/main.c > +++ b/init/main.c > @@ -1035,6 +1035,7 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void) > softirq_init(); > timekeeping_init(); > kfence_init(); > + time_init(); > > /* > * For best initial stack canary entropy, prepare it after: > @@ -1049,7 +1050,6 @@ asmlinkage __visible void __init __no_sanitize_address start_kernel(void) > add_device_randomness(command_line, strlen(command_line)); > boot_init_stack_canary(); > > - time_init(); > perf_event_init(); > profile_init(); > call_function_init(); > -- > 2.35.1 >