Skip to contentSkip to conversation

random: do not check for system_wq initialization in wait event

PATCH In review Jason A. Donenfeld 1 participant 2 messages Apr 30, 2022 – May 1, 2022 Random number driver

lore
Share & tools
lore

Jason A. Donenfeld

author maintainer
#0 lore raw

PATCH 1/1 random: do not check for system_wq initialization in wait event

We previously checked for !system_wq, because when this was called at boot time, it could wind up hitting credit_entropy_bits()->crng_reseed(), which in turn would fire up numa pool initialization in a workqueue. However, we've now gotten rid of those numa pools, and hence do not make use of these workqueues during early init. So we can get rid of the check.

Cc Dominik Brodowski <[email protected]>
Fixes a9412d510ab9 ("random: get rid of secondary crngs")
---
 drivers/char/random.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/char/random.c +2 -3
index 02e880a2c51e..77cee120974d 100644
@@ -1162,9 +1162,8 @@ void add_hwgenerator_randomness(const void *buffer, size_t count,
 	 * CRNG_RESEED_INTERVAL has elapsed.
 	 */
 	wait_event_interruptible_timeout(random_write_wait,
-			!system_wq || kthread_should_stop() ||
-			input_pool.entropy_count < POOL_MIN_BITS,
-			CRNG_RESEED_INTERVAL);
+		kthread_should_stop() || input_pool.entropy_count < POOL_MIN_BITS,
+		CRNG_RESEED_INTERVAL);
 	mix_pool_bytes(buffer, count);
 	credit_entropy_bits(entropy);
 }
Signature · 1 line
2.35.1