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

crypto: caam - one tasklet per job ring

there is no noticeable benefit for multiple cores to process one
job ring's output ring: in fact, we can benefit from cache effects
of having the back-half stay on the core that receives a particular
ring's interrupts, and further relax general contention and the
locking involved with reading outring_used, since tasklets run
atomically.
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 14a8e29c
...@@ -43,7 +43,7 @@ struct caam_drv_private_jr { ...@@ -43,7 +43,7 @@ struct caam_drv_private_jr {
struct device *parentdev; /* points back to controller dev */ struct device *parentdev; /* points back to controller dev */
int ridx; int ridx;
struct caam_job_ring __iomem *rregs; /* JobR's register space */ struct caam_job_ring __iomem *rregs; /* JobR's register space */
struct tasklet_struct irqtask[NR_CPUS]; struct tasklet_struct irqtask;
int irq; /* One per queue */ int irq; /* One per queue */
int assign; /* busy/free */ int assign; /* busy/free */
......
...@@ -43,7 +43,7 @@ static irqreturn_t caam_jr_interrupt(int irq, void *st_dev) ...@@ -43,7 +43,7 @@ static irqreturn_t caam_jr_interrupt(int irq, void *st_dev)
wr_reg32(&jrp->rregs->jrintstatus, irqstate); wr_reg32(&jrp->rregs->jrintstatus, irqstate);
preempt_disable(); preempt_disable();
tasklet_schedule(&jrp->irqtask[smp_processor_id()]); tasklet_schedule(&jrp->irqtask);
preempt_enable(); preempt_enable();
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -322,11 +322,9 @@ static int caam_jr_init(struct device *dev) ...@@ -322,11 +322,9 @@ static int caam_jr_init(struct device *dev)
jrp = dev_get_drvdata(dev); jrp = dev_get_drvdata(dev);
/* Connect job ring interrupt handler. */ tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev);
for_each_possible_cpu(i)
tasklet_init(&jrp->irqtask[i], caam_jr_dequeue,
(unsigned long)dev);
/* Connect job ring interrupt handler. */
error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED,
"caam-jobr", dev); "caam-jobr", dev);
if (error) { if (error) {
...@@ -416,12 +414,11 @@ int caam_jr_shutdown(struct device *dev) ...@@ -416,12 +414,11 @@ int caam_jr_shutdown(struct device *dev)
{ {
struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); struct caam_drv_private_jr *jrp = dev_get_drvdata(dev);
dma_addr_t inpbusaddr, outbusaddr; dma_addr_t inpbusaddr, outbusaddr;
int ret, i; int ret;
ret = caam_reset_hw_jr(dev); ret = caam_reset_hw_jr(dev);
for_each_possible_cpu(i) tasklet_kill(&jrp->irqtask);
tasklet_kill(&jrp->irqtask[i]);
/* Release interrupt */ /* Release interrupt */
free_irq(jrp->irq, dev); free_irq(jrp->irq, dev);
......
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