Re: [PATCH] crypto: marvell/cesa - Avoid empty transfer descriptor

Herbert Xu
2025-05-21T09:16:55Z

On Wed, May 21, 2025 at 01:06:43PM +0800, Herbert Xu wrote:
>
> Can you please try this patch to see if it makes a difference?

Actually, please try this one instead.

Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/drivers/crypto/marvell/cesa/hash.c b/drivers/crypto/marvell/cesa/hash.c
index 6815eddc9068..8a9ea83372c9 100644
--- a/drivers/crypto/marvell/cesa/hash.c
+++ b/drivers/crypto/marvell/cesa/hash.c
@@ -15,6 +15,7 @@
#include <crypto/sha2.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
+#include <linux/dma-map-ops.h>

#include "cesa.h"

@@ -532,6 +533,7 @@ mv_cesa_ahash_dma_add_cache(struct mv_cesa_tdma_chain *chain,
return ret;

memcpy(ahashdreq->cache, creq->cache, creq->cache_ptr);
+ arch_sync_dma_for_device(ahashdreq->cache_dma, creq->cache_ptr, DMA_TO_DEVICE);

return mv_cesa_dma_add_data_transfer(chain,
CESA_SA_DATA_SRAM_OFFSET,