[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUTBQjke3PxSREAu@gondor.apana.org.au>
Date: Fri, 19 Dec 2025 11:06:42 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Chenghai Huang <huangchenghai2@...wei.com>
Cc: davem@...emloft.net, linux-kernel@...r.kernel.org,
linux-crypto@...r.kernel.org, fanghao11@...wei.com,
liulongfang@...wei.com, qianweili@...wei.com,
linwenkai6@...ilicon.com, wangzhou1@...ilicon.com
Subject: Re: [PATCH 2/2] crypto: hisilicon/trng - support tfms sharing the
device
On Thu, Nov 20, 2025 at 09:58:12PM +0800, Chenghai Huang wrote:
>
> +static int hisi_trng_reseed(struct hisi_trng *trng)
> +{
> + u8 seed[SW_DRBG_SEED_SIZE];
> + int size;
>
> - return ret;
> + /* Allow other threads to acquire the lock and execute their jobs. */
> + mutex_unlock(&trng->lock);
> + mutex_lock(&trng->lock);
If we have a bunch threads doing generate, then they will all hit
reseed and end up here for no reason at all.
If you want to stop one thread from hogging the lock, perhaps move
it inside the read loop in hisi_trng_generate?
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