Re: [PATCH v4] crypto: talitos: init tasklets before requesting IRQs

From: Herbert Xu

Date: Thu Oct 08 2026 - 04:49:12 EST


On Sun, Oct 04, 2026 at 02:50:42PM -0700, Rosen Penev wrote:
> The talitos interrupt handlers schedule priv->done_task[] via
> tasklet_schedule(). Since the second IRQ support, probe has requested
> the IRQs before calling tasklet_init(), so an interrupt already pending
> when a line is requested, e.g. engine state left by the bootloader or
> a kexec'd kernel, would schedule a tasklet with a NULL callback.
>
> Look up the IRQ numbers and map the registers up front, so that
> -EPROBE_DEFER returns before anything is allocated and the done_task[]
> selection and reset_device() can see the secondary IRQ. Only request
> the IRQs once the channel fifos are allocated and init_device() has
> reset the engine. This matches remove(), which frees the IRQs before
> killing the tasklets.
>
> remove() frees every IRQ number that is > 0, so make sure that only
> requested lines are set when it runs from the probe error path: clear
> both numbers when probe fails before the request, and clear any line
> talitos_probe_irq() did not request. Previously a failed primary
> request in the two-IRQ case freed the never-requested secondary line.
>
> Fixes: c3e337f88a5b ("crypto: talitos - support for channel remap and 2nd IRQ")
> Assisted-by: LLM
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> v4: actually fix IRQs this time. Add a Fixes: tag.
> v3: reshuffle again to fix IRQs.
> v2: reshuffle code to avoid NULL derefs
> drivers/crypto/talitos.c | 54 ++++++++++++++++++++++++----------------
> 1 file changed, 33 insertions(+), 21 deletions(-)

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