crypto: caam - increase the domain of write memory barrier to full system
authorIuliana Prodan <iuliana.prodan@nxp.com>
Tue, 8 Aug 2023 10:55:26 +0000 (12:55 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Aug 2023 09:01:08 +0000 (17:01 +0800)
commite47e6d2aaacd30e93b97f20d4a20556cefd18406
tree2beedf26514f3a160afa353e2ff106682e65dac7
parente30685204711a6be40dec2622606950ccd37dafe
crypto: caam - increase the domain of write memory barrier to full system

In caam_jr_enqueue, under heavy DDR load, smp_wmb() or dma_wmb()
fail to make the input ring be updated before the CAAM starts
reading it. So, CAAM will process, again, an old descriptor address
and will put it in the output ring. This will make caam_jr_dequeue()
to fail, since this old descriptor is not in the software ring.
To fix this, use wmb() which works on the full system instead of
inner/outer shareable domains.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com>
Reviewed-by: Gaurav Jain <gaurav.jain@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/jr.c