Re: [PATCH] random: fix possible sleeping allocation from irq context

From: Tetsuo Handa
Date: Tue Apr 24 2018 - 20:47:12 EST

Theodore Ts\'o wrote:
> We can do a sleeping allocation from an irq context when CONFIG_NUMA
> is enabled. Fix this by initializing the NUMA crng instances in a
> workqueue.

Offloading to workqueue context itself would be OK,
but this patch makes linux.git unbootable because

if (crng == &primary_crng && crng_init < 2) {
numa_crng_init(); // <= Deferred to workqueue context.
crng_init = 2; // <= Not waiting for workqueue context, and oops before console becomes ready. ;-)
pr_notice(\"random: crng init done\\n\");

Please don\'t pretend rng_ready() before workqueue context is processed.