mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] crypto: ccp: kill v3 IRQ tasklet during teardown
@ 2026-09-20 17:34 Jiale Yao
  2026-09-23  8:58 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Jiale Yao @ 2026-09-20 17:34 UTC (permalink / raw)
  To: Tom Lendacky, John Allen, Herbert Xu, David S. Miller,
	Gary R Hook, linux-crypto, linux-kernel
  Cc: Jiale Yao

On PCI devices using MSI-X, ccp_irq_handler() schedules irq_tasklet. The
teardown paths release the IRQ but do not drain a tasklet that was
already queued, so it can access ccp after the device-managed allocation
has been released.

Kill the tasklet after releasing the IRQ in both the initialization
error path and ccp_destroy().

Fixes: 7b537b24e76a ("crypto: ccp - Change ISR handler method for a v3 CCP")

Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/crypto/ccp/ccp-dev-v3.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/crypto/ccp/ccp-dev-v3.c b/drivers/crypto/ccp/ccp-dev-v3.c
index fe69053b2394..e85b4ded417a 100644
--- a/drivers/crypto/ccp/ccp-dev-v3.c
+++ b/drivers/crypto/ccp/ccp-dev-v3.c
@@ -506,6 +506,8 @@ static int ccp_init(struct ccp_device *ccp)
 			kthread_stop(ccp->cmd_q[i].kthread);
 
 	sp_free_ccp_irq(ccp->sp, ccp);
+	if (ccp->use_tasklet)
+		tasklet_kill(&ccp->irq_tasklet);
 
 e_pool:
 	for (i = 0; i < ccp->cmd_q_count; i++)
@@ -545,6 +547,8 @@ static void ccp_destroy(struct ccp_device *ccp)
 			kthread_stop(ccp->cmd_q[i].kthread);
 
 	sp_free_ccp_irq(ccp->sp, ccp);
+	if (ccp->use_tasklet)
+		tasklet_kill(&ccp->irq_tasklet);
 
 	for (i = 0; i < ccp->cmd_q_count; i++)
 		dma_pool_destroy(ccp->cmd_q[i].dma_pool);
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] crypto: ccp: kill v3 IRQ tasklet during teardown
  2026-09-20 17:34 [PATCH] crypto: ccp: kill v3 IRQ tasklet during teardown Jiale Yao
@ 2026-09-23  8:58 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2026-09-23  8:58 UTC (permalink / raw)
  To: Jiale Yao
  Cc: Tom Lendacky, John Allen, David S. Miller, Gary R Hook,
	linux-crypto, linux-kernel

On Mon, Sep 21, 2026 at 01:34:07AM +0800, Jiale Yao wrote:
> On PCI devices using MSI-X, ccp_irq_handler() schedules irq_tasklet. The
> teardown paths release the IRQ but do not drain a tasklet that was
> already queued, so it can access ccp after the device-managed allocation
> has been released.
> 
> Kill the tasklet after releasing the IRQ in both the initialization
> error path and ccp_destroy().
> 
> Fixes: 7b537b24e76a ("crypto: ccp - Change ISR handler method for a v3 CCP")
> 
> Signed-off-by: Jiale Yao <yaojiale02@163.com>
> ---
>  drivers/crypto/ccp/ccp-dev-v3.c | 4 ++++
>  1 file changed, 4 insertions(+)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-23  8:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-20 17:34 [PATCH] crypto: ccp: kill v3 IRQ tasklet during teardown Jiale Yao
2026-09-23  8:58 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®