[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YqReQbGQ3G5JxSgP@zx2c4.com>
Date: Sat, 11 Jun 2022 11:20:01 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Christophe Leroy <christophe.leroy@...roup.eu>
Cc: "linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH] powerpc/rng: wire up during setup_arch
Hi Christophe,
On Sat, Jun 11, 2022 at 09:16:24AM +0000, Christophe Leroy wrote:
> Le 11/06/2022 à 10:11, Jason A. Donenfeld a écrit :
> > The platform's RNG must be available before random_init() in order to be
> > useful for initial seeding, which in turn means that it needs to be
> > called from setup_arch(), rather than from an init call. Fortunately,
> > each platform already has a setup_arch function pointer, which means
> > it's easy to wire this up for each of the three platforms that have an
> > RNG. This commit also removes some noisy log messages that don't add
> > much.
>
> Can't we use one of the machine initcalls for that ?
> Like machine_early_initcall() or machine_arch_initcall() ?
No, unfortunately. I tried this, and it's still too late. This must be
done in setup_arch().
> Today it is using machine_subsys_initcall() and you didn't remove it.
> It means rng_init() will be called twice. Is that ok ?
I did remove the calls to machine_subsys_initcall(). I just double
checked:
zx2c4@...nkpad ~/Projects/random-linux/arch/powerpc $ rg machine_subsys_initcall platforms/*/rng.c
zx2c4@...nkpad ~/Projects/random-linux/arch/powerpc $
Jason
Powered by blists - more mailing lists