[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZN8F4/qSgjNvjG8h@gondor.apana.org.au>
Date: Fri, 18 Aug 2023 13:47:15 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: meenakshi.aggarwal@....com
Cc: horia.geanta@....com, V.sethi@....com, pankaj.gupta@....com,
gaurav.jain@....com, davem@...emloft.net,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Iuliana Prodan <iuliana.prodan@....com>,
George Cherian <gcherian@...vell.com>,
Weili Qian <qianweili@...wei.com>,
Zhou Wang <wangzhou1@...ilicon.com>
Subject: Re: [PATCH] crypto: caam - increase the domain of write memory
barrier to full system
On Tue, Aug 08, 2023 at 12:55:26PM +0200, meenakshi.aggarwal@....com wrote:
> From: Iuliana Prodan <iuliana.prodan@....com>
>
> 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@....com>
> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@....com>
> ---
> drivers/crypto/caam/jr.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
Indeed, smp_wmb is always wrong for barriers separating DMA writes.
I wonder if these should be changed to:
$ git grep smp_wmb drivers/crypto/
drivers/crypto/caam/jr.c: smp_wmb();
drivers/crypto/cavium/cpt/cptvf_reqmanager.c: smp_wmb();
drivers/crypto/hisilicon/qm.c: smp_wmb();
drivers/crypto/marvell/octeontx/otx_cptvf_reqmgr.c: smp_wmb();
drivers/crypto/marvell/octeontx2/otx2_cptpf_mbox.c: smp_wmb();
drivers/crypto/marvell/octeontx2/otx2_cptpf_mbox.c: smp_wmb();
drivers/crypto/marvell/octeontx2/otx2_cptpf_mbox.c: smp_wmb();
drivers/crypto/marvell/octeontx2/otx2_cptpf_mbox.c: smp_wmb();
drivers/crypto/talitos.c: smp_wmb();
drivers/crypto/talitos.c: smp_wmb();
$
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists