Skip to content

Commit c23116e

Browse files
nxa22042herbertx
authored andcommitted
crypto: caam/jr - Remove extra memory barrier during job ring enqueue
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 <[email protected]> Reviewed-by: Horia Geanta <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 1b30b98 commit c23116e

File tree

1 file changed

+4
-2
lines changed
  • drivers/crypto/caam

1 file changed

+4
-2
lines changed

drivers/crypto/caam/jr.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,11 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,
371371

372372
/*
373373
* Ensure that all job information has been written before
374-
* notifying CAAM that a new job was added to the input ring.
374+
* notifying CAAM that a new job was added to the input ring
375+
* using a memory barrier. The wr_reg32() uses api iowrite32()
376+
* to do the register write. iowrite32() issues a memory barrier
377+
* before the write operation.
375378
*/
376-
wmb();
377379

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

0 commit comments

Comments
 (0)