From: Rosen Penev <rosenp@gmail.com>
To: linux-crypto@vger.kernel.org
Cc: Srujana Challa <schalla@marvell.com>,
Bharat Bhushan <bbhushan2@marvell.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Boris Brezillon <bbrezillon@kernel.org>,
Arnaud Ebalard <arno@natisbad.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCHv2] crypto: cesa: switch to non-devm IRQ to free it earlier
Date: Sun, 12 Jul 2026 20:15:32 -0700 [thread overview]
Message-ID: <20260713031532.2458000-1-rosenp@gmail.com> (raw)
Switch the IRQ request from devm_request_threaded_irq() to
request_threaded_irq() so the IRQ is released explicitly, allowing it to
be freed earlier in the cleanup path rather than deferred to device
teardown.
Add the matching free_irq() and irq_set_affinity_hint(NULL) calls in both
the probe error path and the remove function to release the IRQ and clear
the affinity hint set during probe.
Fixes: f63601fd616ab ("crypto: marvell/cesa - add a new driver for Marvell's CESA")
Assisted-by: opencode:big-pickle
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
v2: fixed Fixes tag and reworded commit
drivers/crypto/marvell/cesa/cesa.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/marvell/cesa/cesa.c b/drivers/crypto/marvell/cesa/cesa.c
index 75d8ba23d9a2..57c9295be711 100644
--- a/drivers/crypto/marvell/cesa/cesa.c
+++ b/drivers/crypto/marvell/cesa/cesa.c
@@ -511,7 +511,7 @@ static int mv_cesa_probe(struct platform_device *pdev)
writel(engine->sram_dma & CESA_SA_SRAM_MSK,
engine->regs + CESA_SA_DESC_P0);
- ret = devm_request_threaded_irq(dev, irq, NULL, mv_cesa_int,
+ ret = request_threaded_irq(irq, NULL, mv_cesa_int,
IRQF_ONESHOT,
dev_name(&pdev->dev),
engine);
@@ -540,6 +540,10 @@ static int mv_cesa_probe(struct platform_device *pdev)
return 0;
err_cleanup:
+ while (i--) {
+ irq_set_affinity_hint(cesa->engines[i].irq, NULL);
+ free_irq(cesa->engines[i].irq, &cesa->engines[i]);
+ }
for (i = 0; i < caps->nengines; i++)
mv_cesa_put_sram(pdev, i);
@@ -553,8 +557,13 @@ static void mv_cesa_remove(struct platform_device *pdev)
mv_cesa_remove_algs(cesa);
- for (i = 0; i < cesa->caps->nengines; i++)
+ for (i = 0; i < cesa->caps->nengines; i++) {
+ struct mv_cesa_engine *engine = &cesa->engines[i];
+
+ irq_set_affinity_hint(engine->irq, NULL);
+ free_irq(engine->irq, engine);
mv_cesa_put_sram(pdev, i);
+ }
}
static const struct platform_device_id mv_cesa_plat_id_table[] = {
--
2.55.0
next reply other threads:[~2026-07-13 3:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 3:15 Rosen Penev [this message]
2026-07-17 8:06 ` [PATCHv2] crypto: cesa: switch to non-devm IRQ to free it earlier Herbert Xu
2026-07-18 1:12 ` Rosen Penev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260713031532.2458000-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=arno@natisbad.org \
--cc=bbhushan2@marvell.com \
--cc=bbrezillon@kernel.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schalla@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox