Re: [PATCH] random: remove mostly unused async readiness notifier

Jason A. Donenfeld
2022-05-18T09:52:53Z

Hi Petr,

On Wed, May 18, 2022 at 10:54:22AM +0200, Petr Mladek wrote:
> > + spin_lock_irqsave(&filling, flags);
>
> I thought more about this and there is a small risk of a deadlock
> when get_random_bytes() or queue_work() or NMI calls
> printk()/vsprintf() with %p here.
>
> A simple solution would be to use trylock():
>
> if (!spin_trylock_irqsave(&filling, flags))
> return -EDEADLK;
>
> Could we do this change, please?
>
> I do not mind if it will be done by re-spinning the original
> patch or another patch on top of it.

Interesting consideration. Sure, I'll do exactly that and send a v2.

Jason