mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
crypto: caam - consolidate memory barriers from job ring en/dequeue
Memory barriers are implied by the i/o register write implementation (at least on Power). So we can remove the redundant wmb() in caam_jr_enqueue, and, in dequeue(), hoist the h/w done notification write up to before we need to increment the head of the ring, and save an smp_mb. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
a8ea07c21d
commit
14a8e29cc2
1 changed files with 2 additions and 6 deletions
|
|
@ -94,7 +94,8 @@ static void caam_jr_dequeue(unsigned long devarg)
|
||||||
userdesc = jrp->entinfo[sw_idx].desc_addr_virt;
|
userdesc = jrp->entinfo[sw_idx].desc_addr_virt;
|
||||||
userstatus = jrp->outring[hw_idx].jrstatus;
|
userstatus = jrp->outring[hw_idx].jrstatus;
|
||||||
|
|
||||||
smp_mb();
|
/* set done */
|
||||||
|
wr_reg32(&jrp->rregs->outring_rmvd, 1);
|
||||||
|
|
||||||
jrp->out_ring_read_index = (jrp->out_ring_read_index + 1) &
|
jrp->out_ring_read_index = (jrp->out_ring_read_index + 1) &
|
||||||
(JOBR_DEPTH - 1);
|
(JOBR_DEPTH - 1);
|
||||||
|
|
@ -114,9 +115,6 @@ static void caam_jr_dequeue(unsigned long devarg)
|
||||||
jrp->tail = tail;
|
jrp->tail = tail;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set done */
|
|
||||||
wr_reg32(&jrp->rregs->outring_rmvd, 1);
|
|
||||||
|
|
||||||
spin_unlock_bh(&jrp->outlock);
|
spin_unlock_bh(&jrp->outlock);
|
||||||
|
|
||||||
/* Finally, execute user's callback */
|
/* Finally, execute user's callback */
|
||||||
|
|
@ -265,8 +263,6 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,
|
||||||
(JOBR_DEPTH - 1);
|
(JOBR_DEPTH - 1);
|
||||||
jrp->head = (head + 1) & (JOBR_DEPTH - 1);
|
jrp->head = (head + 1) & (JOBR_DEPTH - 1);
|
||||||
|
|
||||||
wmb();
|
|
||||||
|
|
||||||
wr_reg32(&jrp->rregs->inpring_jobadd, 1);
|
wr_reg32(&jrp->rregs->inpring_jobadd, 1);
|
||||||
|
|
||||||
spin_unlock(&jrp->inplock);
|
spin_unlock(&jrp->inplock);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue