Skip to content

Commit

Permalink
crypto: caam/jr - Remove extra memory barrier during job ring enqueue
Browse files Browse the repository at this point in the history
In caam_jr_enqueue(), a write barrier is needed to order stores to job
ring slot before declaring addition of new job into input job ring.
The register write is done using wr_reg32() which internally uses
iowrite32() for write operation. The api iowrite32() issues a write
barrier before issuing write operation. Therefore, the wmb() preceding
wr_reg32() can be safely removed.

Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Reviewed-by: Horia Geanta <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
nxa22042 authored and herbertx committed Mar 28, 2019
1 parent 1b30b98 commit c23116e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/crypto/caam/jr.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,

/*
* Ensure that all job information has been written before
* notifying CAAM that a new job was added to the input ring.
* notifying CAAM that a new job was added to the input ring
* using a memory barrier. The wr_reg32() uses api iowrite32()
* to do the register write. iowrite32() issues a memory barrier
* before the write operation.
*/
wmb();

wr_reg32(&jrp->rregs->inpring_jobadd, 1);

Expand Down

0 comments on commit c23116e

Please sign in to comment.