Re: [PATCH v8 1/3] crypto: ti - Add support for AES-CTR in DTHEv2 driver

From: Herbert Xu

Date: Sat Feb 28 2026 - 03:41:11 EST


On Fri, Feb 06, 2026 at 05:07:13PM +0530, T Pratham wrote:
>
> The DMA (at least UDMA in K3 SoCs) sends/receives all the mapped length.
> If I have the dst sg mapped with length (len + x) but write len in
> crypto hardware, the DMA gets stuck waiting for hardware to send the
> extra x len. Similar issue in reverse as well.
>
> Also, FWIW, I'm restoring the len in SG list correctly at the end.

If that's the case wouldn't it also break if the caller supplied
an SG list that's longer than req->cryptlen? There is no requirement
that the SG list must be exactly as long as req->cryptlen and it
can contain extra data at the end.

Perhaps you should use sg_split like sa2ul.

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