Re: [PATCH v5 01/19] crypto: talitos/hash - Use CRYPTO_AHASH_BLOCK_ONLY API
From: Herbert Xu
Date: Fri Sep 18 2026 - 05:30:41 EST
On Mon, Sep 07, 2026 at 03:22:35PM +0200, Paul Louvel wrote:
> The hash implementation maintained a software buffer to accumulate
> partial blocks across update() calls, copying data to/from scatterlists
> with sg_copy_to_buffer()/sg_pcopy_to_buffer() and chaining in a virtual
> scatterlist entry. This is unnecessary now with
> CRYPTO_AHASH_ALG_BLOCK_ONLY flag.
>
> Remove unnecessary fields in the request and export structure. On
> completion, pass any remaining tail bytes back via
> ahash_request_complete() so that the core re-submits them with the next
> request.
>
> Signed-off-by: Paul Louvel <paul.louvel@xxxxxxxxxxx>
> ---
> drivers/crypto/talitos.c | 178 +++++++++++++++++++----------------------------
> 1 file changed, 70 insertions(+), 108 deletions(-)
Please review the Sashiko comments and they seem to identify real
issues:
https://sashiko.dev/#/patchset/20260911-7-3-rc2_talitos_cleanup-v6-0-4215f347c97a%40bootlin.com
> @@ -2111,6 +2052,8 @@ static int ahash_process_req(struct ahash_request *areq, unsigned int nbytes)
> ret = talitos_submit(dev, ctx->ch, &edesc->desc, ahash_done, areq);
> if (ret != -EINPROGRESS)
> free_edesc_list_from(areq, edesc);
> + else
> + req_ctx->message_size += nbytes_to_hash;
Once you submit an async request the request should be considered
to be gone because it may have been freed before the return.
So this update should go to the place where the request is
actually processed and before the completion function has been
invoked, e.g., ahash_done might be a better place for this.
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt