[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrlR7O4roipJt4Nc@gondor.apana.org.au>
Date: Mon, 27 Jun 2022 14:45:00 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: Gregory Erwin <gregerwin256@...il.com>,
linux-wireless@...r.kernel.org, linux-kernel@...r.kernel.org,
Toke Høiland-Jørgensen <toke@...hat.com>,
Kalle Valo <kvalo@...nel.org>,
Rui Salvaterra <rsalvaterra@...il.com>, stable@...r.kernel.org
Subject: Re: [PATCH v2] ath9k: sleep for less time when unregistering hwrng
On Fri, Jun 24, 2022 at 10:44:33PM +0200, Jason A. Donenfeld wrote:
.
> diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
> index 16f227b995e8..af1c1905bb7e 100644
> --- a/drivers/char/hw_random/core.c
> +++ b/drivers/char/hw_random/core.c
> @@ -513,8 +513,13 @@ static int hwrng_fillfn(void *unused)
> break;
>
> if (rc <= 0) {
> - pr_warn("hwrng: no data available\n");
> - msleep_interruptible(10000);
> + int i;
> +
> + for (i = 0; i < 100; ++i) {
> + if (kthread_should_stop() ||
> + msleep_interruptible(10000 / 100))
> + goto out;
> + }
Please use schedule_timeout_interruptible. But if you're going
to make it interruptible it should probably at least try to do
something about signals rather than just ignore them.
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists