Commit 1f647963 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Khalid Elmously

crypto: picoxcell - adjust the position of tasklet_init and fix missed tasklet_kill

BugLink: https://bugs.launchpad.net/bugs/1864775

commit 7f8c36fe upstream.

Since tasklet is needed to be initialized before registering IRQ
handler, adjust the position of tasklet_init to fix the wrong order.

Besides, to fix the missed tasklet_kill, this patch adds a helper
function and uses devm_add_action to kill the tasklet automatically.

Fixes: ce921368 ("crypto: picoxcell - add support for the picoxcell crypto engines")
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 6f0629b2
......@@ -1610,6 +1610,11 @@ static bool spacc_is_compatible(struct platform_device *pdev,
return false;
}
static void spacc_tasklet_kill(void *data)
{
tasklet_kill(data);
}
static int spacc_probe(struct platform_device *pdev)
{
int i, err, ret = -EINVAL;
......@@ -1652,6 +1657,14 @@ static int spacc_probe(struct platform_device *pdev)
return -ENXIO;
}
tasklet_init(&engine->complete, spacc_spacc_complete,
(unsigned long)engine);
ret = devm_add_action(&pdev->dev, spacc_tasklet_kill,
&engine->complete);
if (ret)
return ret;
if (devm_request_irq(&pdev->dev, irq->start, spacc_spacc_irq, 0,
engine->name, engine)) {
dev_err(engine->dev, "failed to request IRQ\n");
......@@ -1714,8 +1727,6 @@ static int spacc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&engine->completed);
INIT_LIST_HEAD(&engine->in_progress);
engine->in_flight = 0;
tasklet_init(&engine->complete, spacc_spacc_complete,
(unsigned long)engine);
platform_set_drvdata(pdev, engine);
......
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