public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, Stafford Horne <shorne@gmail.com>
Subject: Re: [PATCH] init: call time_init() before rand_initialize()
Date: Sat, 7 May 2022 23:09:20 +0200	[thread overview]
Message-ID: <YnbgAGgC0DFBvLcL@zx2c4.com> (raw)
In-Reply-To: <20220507122653.e5ea43e8200568b348b7a16d@linux-foundation.org>

Hi Andrew,

On Sat, May 07, 2022 at 12:26:53PM -0700, Andrew Morton wrote:
> On Thu,  5 May 2022 02:31:14 +0200 "Jason A. Donenfeld" <Jason@zx2c4.com> wrote:
> 
> > Currently time_init() is called before rand_initialize(), but
> 
> You mean "after"!  Changelog was really confusing until I went and
> looked at the code.

Oh dear, yes. Will fix that.

> 
> > 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, 
> 
> return zero from what?

random_get_entropy_fallback(). I'll fix that in the commit message.

> > 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.
> 
> I hope you're right.  Moving these things around tends to fix one thing
> and break another.

I hope so too. Reading the platform code for every arch I can't see
where breakage would be. Nothing in the time init functions relies on
the rng being available, and actually, the rng is already quasi
functional before the call to rand_initialize(), so I think it should be
good. Nonetheless:

> No probs.  Plenty of testing in linux-next, please.

Exactly this. Plus the CI on build.wireguard.com and such is churning on
it on a variety of different archs.

Jason

  reply	other threads:[~2022-05-07 21:09 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 [this message]
2022-05-08  0:20     ` [PATCH v2] " Jason A. Donenfeld
2022-05-13 21:18 ` [PATCH] " Stafford Horne

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=YnbgAGgC0DFBvLcL@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shorne@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox