Skip to content

Commit 40405f1

Browse files
kimphillherbertx
authored andcommitted
crypto: talitos - Pass correct interrupt status to error handler
Since we ack early, the re-read interrupt status in talitos_error may be already updated with a new value. Pass the error ISR value directly in order to report and handle the error based on the correct error status. Also remove unused error tasklet. Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Lee Nipper <lee.nipper@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent a44b56c commit 40405f1

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎drivers/crypto/talitos.c‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ struct talitos_private {
127127

128128
/* request callback tasklet */
129129
struct tasklet_struct done_task;
130-
struct tasklet_struct error_task;
131130

132131
/* list of registered algorithms */
133132
struct list_head alg_list;
@@ -469,16 +468,13 @@ static void report_eu_error(struct device *dev, int ch, struct talitos_desc *des
469468
/*
470469
* recover from error interrupts
471470
*/
472-
static void talitos_error(unsigned long data)
471+
static void talitos_error(unsigned long data, u32 isr, u32 isr_lo)
473472
{
474473
struct device *dev = (struct device *)data;
475474
struct talitos_private *priv = dev_get_drvdata(dev);
476475
unsigned int timeout = TALITOS_TIMEOUT;
477476
int ch, error, reset_dev = 0, reset_ch = 0;
478-
u32 isr, isr_lo, v, v_lo;
479-
480-
isr = in_be32(priv->reg + TALITOS_ISR);
481-
isr_lo = in_be32(priv->reg + TALITOS_ISR_LO);
477+
u32 v, v_lo;
482478

483479
for (ch = 0; ch < priv->num_channels; ch++) {
484480
/* skip channels without errors */
@@ -566,7 +562,7 @@ static irqreturn_t talitos_interrupt(int irq, void *data)
566562
out_be32(priv->reg + TALITOS_ICR_LO, isr_lo);
567563

568564
if (unlikely((isr & ~TALITOS_ISR_CHDONE) || isr_lo))
569-
talitos_error((unsigned long)data);
565+
talitos_error((unsigned long)data, isr, isr_lo);
570566
else
571567
if (likely(isr & TALITOS_ISR_CHDONE))
572568
tasklet_schedule(&priv->done_task);
@@ -1391,7 +1387,6 @@ static int talitos_remove(struct of_device *ofdev)
13911387
}
13921388

13931389
tasklet_kill(&priv->done_task);
1394-
tasklet_kill(&priv->error_task);
13951390

13961391
iounmap(priv->reg);
13971392

@@ -1454,7 +1449,6 @@ static int talitos_probe(struct of_device *ofdev,
14541449
INIT_LIST_HEAD(&priv->alg_list);
14551450

14561451
tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev);
1457-
tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev);
14581452

14591453
priv->irq = irq_of_parse_and_map(np, 0);
14601454

0 commit comments

Comments
 (0)