All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] random: do not check for system_wq initialization in wait event
@ 2022-04-30 19:56 Jason A. Donenfeld
  2022-05-01 12:37 ` Jason A. Donenfeld
  0 siblings, 1 reply; 2+ messages in thread
From: Jason A. Donenfeld @ 2022-04-30 19:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jason A. Donenfeld, Dominik Brodowski

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 <linux@dominikbrodowski.net>
Fixes: a9412d510ab9 ("random: get rid of secondary crngs")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 drivers/char/random.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 02e880a2c51e..77cee120974d 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -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);
 }
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] random: do not check for system_wq initialization in wait event
  2022-04-30 19:56 [PATCH] random: do not check for system_wq initialization in wait event Jason A. Donenfeld
@ 2022-05-01 12:37 ` Jason A. Donenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Jason A. Donenfeld @ 2022-05-01 12:37 UTC (permalink / raw)
  To: LKML; +Cc: Dominik Brodowski

Still required actually. Dropping this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-01 12:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30 19:56 [PATCH] random: do not check for system_wq initialization in wait event Jason A. Donenfeld
2022-05-01 12:37 ` Jason A. Donenfeld

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.