diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2012-06-22 20:48:57 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2012-06-27 02:42:07 -0400 |
commit | a0ca6ca022ac197e159bb5d22a08e3c3aebb242c (patch) | |
tree | fbd194b3c93e8cf2938e1e4317a926578c22bc96 /drivers/crypto | |
parent | 14a8e29cc2012394d3e886b11402eabd49a4d609 (diff) |
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: Kim Phillips <kim.phillips@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/intern.h | 2 | ||||
-rw-r--r-- | drivers/crypto/caam/jr.c | 13 |
2 files changed, 6 insertions, 9 deletions
diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h index ed2b739f934b..5cd4c1b268a1 100644 --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h | |||
@@ -43,7 +43,7 @@ struct caam_drv_private_jr { | |||
43 | struct device *parentdev; /* points back to controller dev */ | 43 | struct device *parentdev; /* points back to controller dev */ |
44 | int ridx; | 44 | int ridx; |
45 | struct caam_job_ring __iomem *rregs; /* JobR's register space */ | 45 | struct caam_job_ring __iomem *rregs; /* JobR's register space */ |
46 | struct tasklet_struct irqtask[NR_CPUS]; | 46 | struct tasklet_struct irqtask; |
47 | int irq; /* One per queue */ | 47 | int irq; /* One per queue */ |
48 | int assign; /* busy/free */ | 48 | int assign; /* busy/free */ |
49 | 49 | ||
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index 0adaad1b8cf7..7074a1a29e8b 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c | |||
@@ -43,7 +43,7 @@ static irqreturn_t caam_jr_interrupt(int irq, void *st_dev) | |||
43 | wr_reg32(&jrp->rregs->jrintstatus, irqstate); | 43 | wr_reg32(&jrp->rregs->jrintstatus, irqstate); |
44 | 44 | ||
45 | preempt_disable(); | 45 | preempt_disable(); |
46 | tasklet_schedule(&jrp->irqtask[smp_processor_id()]); | 46 | tasklet_schedule(&jrp->irqtask); |
47 | preempt_enable(); | 47 | preempt_enable(); |
48 | 48 | ||
49 | return IRQ_HANDLED; | 49 | return IRQ_HANDLED; |
@@ -322,11 +322,9 @@ static int caam_jr_init(struct device *dev) | |||
322 | 322 | ||
323 | jrp = dev_get_drvdata(dev); | 323 | jrp = dev_get_drvdata(dev); |
324 | 324 | ||
325 | /* Connect job ring interrupt handler. */ | 325 | tasklet_init(&jrp->irqtask, caam_jr_dequeue, (unsigned long)dev); |
326 | for_each_possible_cpu(i) | ||
327 | tasklet_init(&jrp->irqtask[i], caam_jr_dequeue, | ||
328 | (unsigned long)dev); | ||
329 | 326 | ||
327 | /* Connect job ring interrupt handler. */ | ||
330 | error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, | 328 | error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED, |
331 | "caam-jobr", dev); | 329 | "caam-jobr", dev); |
332 | if (error) { | 330 | if (error) { |
@@ -416,12 +414,11 @@ int caam_jr_shutdown(struct device *dev) | |||
416 | { | 414 | { |
417 | struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); | 415 | struct caam_drv_private_jr *jrp = dev_get_drvdata(dev); |
418 | dma_addr_t inpbusaddr, outbusaddr; | 416 | dma_addr_t inpbusaddr, outbusaddr; |
419 | int ret, i; | 417 | int ret; |
420 | 418 | ||
421 | ret = caam_reset_hw_jr(dev); | 419 | ret = caam_reset_hw_jr(dev); |
422 | 420 | ||
423 | for_each_possible_cpu(i) | 421 | tasklet_kill(&jrp->irqtask); |
424 | tasklet_kill(&jrp->irqtask[i]); | ||
425 | 422 | ||
426 | /* Release interrupt */ | 423 | /* Release interrupt */ |
427 | free_irq(jrp->irq, dev); | 424 | free_irq(jrp->irq, dev); |