Re: [PATCH 2/2] crypto: img-hash: fix IRQ teardown ordering and fetch clocks early

From: Herbert Xu

Date: Fri Sep 04 2026 - 05:41:40 EST


On Tue, Aug 11, 2026 at 02:20:30PM -0700, Rosen Penev wrote:
> The IRQ handler schedules tasklets, so free_irq must run before
> tasklet_kill in img_hash_remove(). devm_request_irq only freed the
> IRQ during devm unwind, after remove() returned, leaving a race in
> which the handler could re-schedule a tasklet during teardown.
> Replace it with request_irq and free the IRQ explicitly in remove()
> and in the probe error path.
>
> Assisted-by: opencode:deepseek-v4-flash-free
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> drivers/crypto/img-hash.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)

There are much bigger problems with device removal while the
Crypto API is actively using the tfm. There is no point in
fixing these issues until the bigger problem is addressed first.

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