From: Kalle Valo <kvalo@kernel.org>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: "Herbert Xu" <herbert@gondor.apana.org.au>,
linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
"Gregory Erwin" <gregerwin256@gmail.com>,
"Toke Høiland-Jørgensen" <toke@redhat.com>,
"Rui Salvaterra" <rsalvaterra@gmail.com>,
"Ingo Molnar" <mingo@redhat.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Juri Lelli" <juri.lelli@redhat.com>,
"Vincent Guittot" <vincent.guittot@linaro.org>,
"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Ben Segall" <bsegall@google.com>, "Mel Gorman" <mgorman@suse.de>,
"Daniel Bristot de Oliveira" <bristot@redhat.com>,
"Valentin Schneider" <vschneid@redhat.com>,
"Christian Brauner" <brauner@kernel.org>,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH v8] ath9k: let sleep be interrupted when unregistering hwrng
Date: Thu, 07 Jul 2022 19:26:27 +0300 [thread overview]
Message-ID: <87v8s8ubws.fsf@kernel.org> (raw)
In-Reply-To: <20220629114240.946411-1-Jason@zx2c4.com> (Jason A. Donenfeld's message of "Wed, 29 Jun 2022 13:42:40 +0200")
"Jason A. Donenfeld" <Jason@zx2c4.com> 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 <gregerwin256@gmail.com>
> Cc: Toke Høiland-Jørgensen <toke@redhat.com>
> Cc: Kalle Valo <kvalo@kernel.org>
> Cc: Rui Salvaterra <rsalvaterra@gmail.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: stable@vger.kernel.org
> Fixes: fcd09c90c3c5 ("ath9k: use hw_random API instead of directly dumping into random.c")
> Link: https://lore.kernel.org/all/CAO+Okf6ZJC5-nTE_EJUGQtd8JiCkiEHytGgDsFGTEjs0c00giw@mail.gmail.com/
> Link: https://lore.kernel.org/lkml/CAO+Okf5k+C+SE6pMVfPf-d8MfVPVq4PO7EY8Hys_DVXtent3HA@mail.gmail.com/
> Link: https://bugs.archlinux.org/task/75138
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> Changes v7->v8:
> - Add a missing export_symbol.
>
> drivers/char/hw_random/core.c | 30 ++++++++++++++++++++++++----
> drivers/net/wireless/ath/ath9k/rng.c | 19 +++++++-----------
> kernel/sched/core.c | 1 +
> 3 files changed, 34 insertions(+), 16 deletions(-)
I don't see any acks for the hw_random and the scheduler change, adding more
people to CC. Full patch here:
https://patchwork.kernel.org/project/linux-wireless/patch/20220629114240.946411-1-Jason@zx2c4.com/
Are everyone ok if I take this patch via wireless-next?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2022-07-07 16:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 15:18 [PATCH v7] ath9k: let sleep be interrupted when unregistering hwrng Jason A. Donenfeld
2022-06-29 3:41 ` Gregory Erwin
2022-06-29 11:37 ` Jason A. Donenfeld
2022-06-29 11:42 ` [PATCH v8] " Jason A. Donenfeld
2022-06-29 15:28 ` Greg KH
2022-06-29 16:15 ` Jason A. Donenfeld
2022-06-29 16:49 ` Greg KH
2022-06-30 14:03 ` Jason A. Donenfeld
2022-07-01 1:17 ` Gregory Erwin
2022-07-04 22:04 ` Toke Høiland-Jørgensen
2022-07-07 16:26 ` Kalle Valo [this message]
2022-07-11 11:41 ` Valentin Schneider
2022-07-11 11:53 ` Jason A. Donenfeld
2022-07-19 15:15 ` Valentin Schneider
2022-07-19 17:21 ` Jason A. Donenfeld
2022-07-19 17:33 ` [PATCH v9] " Jason A. Donenfeld
2022-07-19 19:25 ` Eric W. Biederman
2022-07-19 20:05 ` Jason A. Donenfeld
2022-07-19 20:11 ` [PATCH v10] " Jason A. Donenfeld
2022-07-19 20:51 ` Eric W. Biederman
2022-07-19 20:55 ` Jason A. Donenfeld
2022-07-22 20:08 ` Valentin Schneider
2022-07-22 20:13 ` Jason A. Donenfeld
2022-07-25 10:08 ` Valentin Schneider
2022-07-25 11:41 ` Jason A. Donenfeld
2022-07-25 17:56 ` Valentin Schneider
2022-06-29 9:24 ` [PATCH v7] " Toke Høiland-Jørgensen
2022-06-29 11:40 ` Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87v8s8ubws.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=Jason@zx2c4.com \
--cc=brauner@kernel.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=dietmar.eggemann@arm.com \
--cc=gregerwin256@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=juri.lelli@redhat.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=rsalvaterra@gmail.com \
--cc=toke@redhat.com \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).