Re: [PATCH] crypto: eip93: fix IRQ teardown ordering in remove path
From: Herbert Xu
Date: Fri Sep 18 2026 - 05:01:02 EST
On Wed, Sep 09, 2026 at 02:12:18PM -0700, Rosen Penev wrote:
> Switch from devm_request_threaded_irq() to request_threaded_irq() so
> that free_irq() can be called at the correct position in the remove
> path. Move the IRQ registration after tasklet_init() in probe to
> ensure the tasklet is ready before the handler can fire.
>
> Reorder eip93_cleanup() to:
> 1. disable device interrupts (HW)
> 2. free_irq() - synchronizes and removes the handler
> 3. tasklet_kill() - safe, no new IRQs can arrive
>
> The previous order (tasklet_kill before interrupt disable) could race:
> an IRQ arriving after tasklet_kill() would schedule the already-killed
> tasklet. With devm_request_threaded_irq(), free_irq() ran after the
> remove callback returned, leaving the handler registered while device
> state was being torn down.
>
> Assisted-by: opencode:big-pickle
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> .../crypto/inside-secure/eip93/eip93-main.c | 27 ++++++++++++-------
> 1 file changed, 18 insertions(+), 9 deletions(-)
Please check
https://sashiko.dev/#/patchset/20260909211218.15388-1-rosenp%40gmail.com
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt