[PATCH v11 11/22] crypto: amlogic - Introduce hasher

Herbert Xu herbert at gondor.apana.org.au
Tue Feb 11 19:51:13 PST 2025


On Wed, Jan 22, 2025 at 03:41:29PM +0300, Alexey Romanov wrote:
> 
> Why? I couldn't find this explanation anywhere.

Because the digest function can be called from atomic contexts,
such as networking.

> In addition, I found an example of one of the digest functions that is sleeping [1].
> 
> Links:
> 
>   - [1] https://elixir.bootlin.com/linux/v6.12.6/source/drivers/crypto/mxs-dcp.c#L804

That driver is just broken.  If you look through the git history,
you'll find that a similar problem was fixed by replacing the
mutex with a spinlock in the cipher path.  Unfortunately the same
fix hasn't been extended to hashing in mxs-dcp.

Cheeers,
-- 
Email: Herbert Xu <herbert at gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



More information about the linux-amlogic mailing list