Revert "random: do not use jump labels before they are initialized"
authorDom Cobley <popcornmix@gmail.com>
Wed, 15 Jun 2022 14:54:33 +0000 (15:54 +0100)
committerDom Cobley <popcornmix@gmail.com>
Wed, 15 Jun 2022 14:54:33 +0000 (15:54 +0100)
This reverts commit 7a2d8599ce48cf25b2c2177139e6ce448525c3e9.

drivers/char/random.c

index 136c671..e2f1fce 100644 (file)
@@ -727,8 +727,7 @@ static void __cold _credit_init_bits(size_t bits)
 
        if (orig < POOL_READY_BITS && new >= POOL_READY_BITS) {
                crng_reseed(); /* Sets crng_init to CRNG_READY under base_crng.lock. */
-               if (static_key_initialized)
-                       execute_in_process_context(crng_set_ready, &set_ready);
+               execute_in_process_context(crng_set_ready, &set_ready);
                process_random_ready_list();
                wake_up_interruptible(&crng_init_wait);
                kill_fasync(&fasync, SIGIO, POLL_IN);
@@ -844,14 +843,6 @@ int __init random_init(const char *command_line)
        _mix_pool_bytes(command_line, strlen(command_line));
        add_latent_entropy();
 
-       /*
-        * If we were initialized by the bootloader before jump labels are
-        * initialized, then we should enable the static branch here, where
-        * it's guaranteed that jump labels have been initialized.
-        */
-       if (!static_branch_likely(&crng_is_ready) && crng_init >= CRNG_READY)
-               crng_set_ready(NULL);
-
        if (crng_ready())
                crng_reseed();
        else if (trust_cpu)