diff options
author | Kim Phillips <kim.phillips@freescale.com> | 2008-10-12 08:19:35 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-12-24 19:01:09 -0500 |
commit | 40405f10b853ef404b395c6febca71b0de185490 (patch) | |
tree | 384810d21a97211fc1e4f05a3b08682fc15d9e8e /drivers/crypto/talitos.c | |
parent | a44b56cc69a5b017f396ed1daeaef6a63e086656 (diff) |
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>
Diffstat (limited to 'drivers/crypto/talitos.c')
-rw-r--r-- | drivers/crypto/talitos.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 24607669a52b..c429f684c79d 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c | |||
@@ -127,7 +127,6 @@ struct talitos_private { | |||
127 | 127 | ||
128 | /* request callback tasklet */ | 128 | /* request callback tasklet */ |
129 | struct tasklet_struct done_task; | 129 | struct tasklet_struct done_task; |
130 | struct tasklet_struct error_task; | ||
131 | 130 | ||
132 | /* list of registered algorithms */ | 131 | /* list of registered algorithms */ |
133 | struct list_head alg_list; | 132 | struct list_head alg_list; |
@@ -469,16 +468,13 @@ static void report_eu_error(struct device *dev, int ch, struct talitos_desc *des | |||
469 | /* | 468 | /* |
470 | * recover from error interrupts | 469 | * recover from error interrupts |
471 | */ | 470 | */ |
472 | static void talitos_error(unsigned long data) | 471 | static void talitos_error(unsigned long data, u32 isr, u32 isr_lo) |
473 | { | 472 | { |
474 | struct device *dev = (struct device *)data; | 473 | struct device *dev = (struct device *)data; |
475 | struct talitos_private *priv = dev_get_drvdata(dev); | 474 | struct talitos_private *priv = dev_get_drvdata(dev); |
476 | unsigned int timeout = TALITOS_TIMEOUT; | 475 | unsigned int timeout = TALITOS_TIMEOUT; |
477 | int ch, error, reset_dev = 0, reset_ch = 0; | 476 | int ch, error, reset_dev = 0, reset_ch = 0; |
478 | u32 isr, isr_lo, v, v_lo; | 477 | u32 v, v_lo; |
479 | |||
480 | isr = in_be32(priv->reg + TALITOS_ISR); | ||
481 | isr_lo = in_be32(priv->reg + TALITOS_ISR_LO); | ||
482 | 478 | ||
483 | for (ch = 0; ch < priv->num_channels; ch++) { | 479 | for (ch = 0; ch < priv->num_channels; ch++) { |
484 | /* skip channels without errors */ | 480 | /* skip channels without errors */ |
@@ -566,7 +562,7 @@ static irqreturn_t talitos_interrupt(int irq, void *data) | |||
566 | out_be32(priv->reg + TALITOS_ICR_LO, isr_lo); | 562 | out_be32(priv->reg + TALITOS_ICR_LO, isr_lo); |
567 | 563 | ||
568 | if (unlikely((isr & ~TALITOS_ISR_CHDONE) || isr_lo)) | 564 | if (unlikely((isr & ~TALITOS_ISR_CHDONE) || isr_lo)) |
569 | talitos_error((unsigned long)data); | 565 | talitos_error((unsigned long)data, isr, isr_lo); |
570 | else | 566 | else |
571 | if (likely(isr & TALITOS_ISR_CHDONE)) | 567 | if (likely(isr & TALITOS_ISR_CHDONE)) |
572 | tasklet_schedule(&priv->done_task); | 568 | tasklet_schedule(&priv->done_task); |
@@ -1391,7 +1387,6 @@ static int talitos_remove(struct of_device *ofdev) | |||
1391 | } | 1387 | } |
1392 | 1388 | ||
1393 | tasklet_kill(&priv->done_task); | 1389 | tasklet_kill(&priv->done_task); |
1394 | tasklet_kill(&priv->error_task); | ||
1395 | 1390 | ||
1396 | iounmap(priv->reg); | 1391 | iounmap(priv->reg); |
1397 | 1392 | ||
@@ -1454,7 +1449,6 @@ static int talitos_probe(struct of_device *ofdev, | |||
1454 | INIT_LIST_HEAD(&priv->alg_list); | 1449 | INIT_LIST_HEAD(&priv->alg_list); |
1455 | 1450 | ||
1456 | tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev); | 1451 | tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev); |
1457 | tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev); | ||
1458 | 1452 | ||
1459 | priv->irq = irq_of_parse_and_map(np, 0); | 1453 | priv->irq = irq_of_parse_and_map(np, 0); |
1460 | 1454 | ||