提交 40405f10 编写于 作者: K Kim Phillips 提交者: Herbert Xu

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: NKim Phillips <kim.phillips@freescale.com>
Signed-off-by: NLee Nipper <lee.nipper@freescale.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 a44b56cc
...@@ -127,7 +127,6 @@ struct talitos_private { ...@@ -127,7 +127,6 @@ struct talitos_private {
/* request callback tasklet */ /* request callback tasklet */
struct tasklet_struct done_task; struct tasklet_struct done_task;
struct tasklet_struct error_task;
/* list of registered algorithms */ /* list of registered algorithms */
struct list_head alg_list; struct list_head alg_list;
...@@ -469,16 +468,13 @@ static void report_eu_error(struct device *dev, int ch, struct talitos_desc *des ...@@ -469,16 +468,13 @@ static void report_eu_error(struct device *dev, int ch, struct talitos_desc *des
/* /*
* recover from error interrupts * recover from error interrupts
*/ */
static void talitos_error(unsigned long data) static void talitos_error(unsigned long data, u32 isr, u32 isr_lo)
{ {
struct device *dev = (struct device *)data; struct device *dev = (struct device *)data;
struct talitos_private *priv = dev_get_drvdata(dev); struct talitos_private *priv = dev_get_drvdata(dev);
unsigned int timeout = TALITOS_TIMEOUT; unsigned int timeout = TALITOS_TIMEOUT;
int ch, error, reset_dev = 0, reset_ch = 0; int ch, error, reset_dev = 0, reset_ch = 0;
u32 isr, isr_lo, v, v_lo; u32 v, v_lo;
isr = in_be32(priv->reg + TALITOS_ISR);
isr_lo = in_be32(priv->reg + TALITOS_ISR_LO);
for (ch = 0; ch < priv->num_channels; ch++) { for (ch = 0; ch < priv->num_channels; ch++) {
/* skip channels without errors */ /* skip channels without errors */
...@@ -566,7 +562,7 @@ static irqreturn_t talitos_interrupt(int irq, void *data) ...@@ -566,7 +562,7 @@ static irqreturn_t talitos_interrupt(int irq, void *data)
out_be32(priv->reg + TALITOS_ICR_LO, isr_lo); out_be32(priv->reg + TALITOS_ICR_LO, isr_lo);
if (unlikely((isr & ~TALITOS_ISR_CHDONE) || isr_lo)) if (unlikely((isr & ~TALITOS_ISR_CHDONE) || isr_lo))
talitos_error((unsigned long)data); talitos_error((unsigned long)data, isr, isr_lo);
else else
if (likely(isr & TALITOS_ISR_CHDONE)) if (likely(isr & TALITOS_ISR_CHDONE))
tasklet_schedule(&priv->done_task); tasklet_schedule(&priv->done_task);
...@@ -1391,7 +1387,6 @@ static int talitos_remove(struct of_device *ofdev) ...@@ -1391,7 +1387,6 @@ static int talitos_remove(struct of_device *ofdev)
} }
tasklet_kill(&priv->done_task); tasklet_kill(&priv->done_task);
tasklet_kill(&priv->error_task);
iounmap(priv->reg); iounmap(priv->reg);
...@@ -1454,7 +1449,6 @@ static int talitos_probe(struct of_device *ofdev, ...@@ -1454,7 +1449,6 @@ static int talitos_probe(struct of_device *ofdev,
INIT_LIST_HEAD(&priv->alg_list); INIT_LIST_HEAD(&priv->alg_list);
tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev); tasklet_init(&priv->done_task, talitos_done, (unsigned long)dev);
tasklet_init(&priv->error_task, talitos_error, (unsigned long)dev);
priv->irq = irq_of_parse_and_map(np, 0); priv->irq = irq_of_parse_and_map(np, 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册