Re: [PATCH v6 2/2] crypto: caam - Use bounce buffer for unaligned RSA destination buffers
From: Sahil Malhotra
Date: Mon Nov 16 2026 - 13:05:31 EST
On Sat, Nov 14, 2026 at 05:00:32PM +1100, Changwei Zou wrote:
> The rsa-caam driver directly DMA-maps the destination buffer supplied by
> the caller via req->dst without checking whether it meets the cacheline
> alignment requirements of DMA-incoherent hardware such as i.MX8.
Hi Changwei,
Thanks for v6. Using req_ctx->fixup_dst instead of swapping req->dst
makes this much cleaner, and the commit message now explains why the
DMA API does not catch this case.
I re-checked all completion and error paths: the DMA unmap always
happens before the copy-back/free, the -ENOSPC retry and -EBUSY
backlog paths keep the bounce buffer alive, and the new bounce_fail
label also fixes the src-map-failure path.
Reviewed-by: Sahil Malhotra <sahil.malhotra@xxxxxxx>
Thanks,
Sahil