All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stafford Horne <shorne@gmail.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] init: call time_init() before rand_initialize()
Date: Sat, 14 May 2022 06:18:19 +0900	[thread overview]
Message-ID: <Yn7LG3zlcKPaOXkp@antec> (raw)
In-Reply-To: <20220505003114.177552-1-Jason@zx2c4.com>

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 <shorne@gmail.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

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 <shorne@gmail.com>

> ---
> 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
> 

      parent reply	other threads:[~2022-05-13 21:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-05  0:31 [PATCH] init: call time_init() before rand_initialize() Jason A. Donenfeld
2022-05-07 19:26 ` Andrew Morton
2022-05-07 21:09   ` Jason A. Donenfeld
2022-05-08  0:20     ` [PATCH v2] " Jason A. Donenfeld
2022-05-13 21:18 ` Stafford Horne [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yn7LG3zlcKPaOXkp@antec \
    --to=shorne@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.