lkml.org 
[lkml]   [2022]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 2/3] powerpc/powernv: wire up rng during setup_arch
Date
"Jason A. Donenfeld" <Jason@zx2c4.com> writes:
> 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. This commit also removes some noisy log
> messages that don't add much.
>
> Cc: stable@vger.kernel.org
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
> Fixes: a4da0d50b2a0 ("powerpc: Implement arch_get_random_long/int() for powernv")
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> arch/powerpc/platforms/powernv/powernv.h | 2 ++
> arch/powerpc/platforms/powernv/rng.c | 18 +++++-------------
> arch/powerpc/platforms/powernv/setup.c | 2 ++
> 3 files changed, 9 insertions(+), 13 deletions(-)
>
...
> diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
> index 824c3ad7a0fa..a5fcb6796b22 100644
> --- a/arch/powerpc/platforms/powernv/setup.c
> +++ b/arch/powerpc/platforms/powernv/setup.c
> @@ -203,6 +203,8 @@ static void __init pnv_setup_arch(void)
> pnv_check_guarded_cores();
>
> /* XXX PMCS */
> +
> + powernv_rng_init();
> }

This crashes on power8 because it's too early to call kzalloc() in
rng_create(), and it's also too early to setup the percpu variables in
there.

I'll rework it and post a v4.

cheers

\
 
 \ /
  Last update: 2022-06-19 13:50    [W:0.088 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site