[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v8] ath9k: let sleep be interrupted when unregistering hwrng
"Jason A. Donenfeld" <> writes:

> There are two deadlock scenarios that need addressing, which cause
> problems when the computer goes to sleep, the interface is set down, and
> hwrng_unregister() is called. When the deadlock is hit, sleep is delayed
> for tens of seconds, causing it to fail. These scenarios are:
> 1) The hwrng kthread can't be stopped while it's sleeping, because it
> uses msleep_interruptible() instead of schedule_timeout_interruptible().
> The fix is a simple moving to the correct function. At the same time,
> we should cleanup a common and useless dmesg splat in the same area.
> 2) A normal user thread can't be interrupted by hwrng_unregister() while
> it's sleeping, because hwrng_unregister() is called from elsewhere.
> The solution here is to keep track of which thread is currently
> reading, and asleep, and signal that thread when it's time to
> unregister. There's a bit of book keeping required to prevent
> lifetime issues on current.
> Reported-by: Gregory Erwin <>
> Cc: Toke Høiland-Jørgensen <>
> Cc: Kalle Valo <>
> Cc: Rui Salvaterra <>
> Cc: Herbert Xu <>
> Cc:
> Fixes: fcd09c90c3c5 ("ath9k: use hw_random API instead of directly dumping into random.c")
> Link:
> Link:
> Link:
> Signed-off-by: Jason A. Donenfeld <>

With the change to EXPORT_SYMBOL_GPL() for wake_up_state that Kalle has
kindly agreed to fix up while applying:

Acked-by: Toke Høiland-Jørgensen <>

 \ /
  Last update: 2022-07-05 00:08    [W:0.085 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site