Commit a8ea07c2 authored by Kim Phillips's avatar Kim Phillips Committed by Herbert Xu

crypto: caam - only query h/w in job ring dequeue path

Code was needlessly checking the s/w job ring when there
would be nothing to process if the h/w's output completion
ring were empty anyway.
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 4bba1e9f
...@@ -59,15 +59,15 @@ static void caam_jr_dequeue(unsigned long devarg) ...@@ -59,15 +59,15 @@ static void caam_jr_dequeue(unsigned long devarg)
u32 *userdesc, userstatus; u32 *userdesc, userstatus;
void *userarg; void *userarg;
spin_lock_bh(&jrp->outlock); while (rd_reg32(&jrp->rregs->outring_used)) {
head = ACCESS_ONCE(jrp->head); head = ACCESS_ONCE(jrp->head);
sw_idx = tail = jrp->tail;
while (CIRC_CNT(head, tail, JOBR_DEPTH) >= 1 && spin_lock_bh(&jrp->outlock);
rd_reg32(&jrp->rregs->outring_used)) {
sw_idx = tail = jrp->tail;
hw_idx = jrp->out_ring_read_index; hw_idx = jrp->out_ring_read_index;
for (i = 0; CIRC_CNT(head, tail + i, JOBR_DEPTH) >= 1; i++) { for (i = 0; CIRC_CNT(head, tail + i, JOBR_DEPTH) >= 1; i++) {
sw_idx = (tail + i) & (JOBR_DEPTH - 1); sw_idx = (tail + i) & (JOBR_DEPTH - 1);
...@@ -121,15 +121,8 @@ static void caam_jr_dequeue(unsigned long devarg) ...@@ -121,15 +121,8 @@ static void caam_jr_dequeue(unsigned long devarg)
/* Finally, execute user's callback */ /* Finally, execute user's callback */
usercall(dev, userdesc, userstatus, userarg); usercall(dev, userdesc, userstatus, userarg);
spin_lock_bh(&jrp->outlock);
head = ACCESS_ONCE(jrp->head);
sw_idx = tail = jrp->tail;
} }
spin_unlock_bh(&jrp->outlock);
/* reenable / unmask IRQs */ /* reenable / unmask IRQs */
clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK); clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment