random: do not take pool spinlock at boot
authorJason A. Donenfeld <Jason@zx2c4.com>
Sat, 12 Feb 2022 00:26:17 +0000 (01:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:35 +0000 (11:46 +0200)
commit58e0c4ff5342e1962a7464d18568a55a0fc26c9f
treefa0fe524afcbb8ca64a911c679289a7edaaaa75c
parent80adfc1fa6910c5e90720b7fb9c7a1686b8ccd58
random: do not take pool spinlock at boot

commit afba0b80b977b2a8f16234f2acd982f82710ba33 upstream.

Since rand_initialize() is run while interrupts are still off and
nothing else is running, we don't need to repeatedly take and release
the pool spinlock, especially in the RDSEED loop.

Reviewed-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c