Re: [PATCH] crypto: cesa: complete pending requests on device remove
From: Herbert Xu
Date: Wed Sep 23 2026 - 01:45:54 EST
On Wed, Sep 16, 2026 at 04:05:26PM -0700, Rosen Penev wrote:
> mv_cesa_remove() unregisters the algorithms and frees the IRQs but never
> drains the engine queues. Each engine can still hold outstanding requests
> in three places: engine->req (currently in flight), engine->queue (queued
> but not started), and engine->complete_queue (processed but not yet
> reported). The latter two are only completed from the IRQ handler, which
> is torn down before they are flushed.
>
> If the device is unbound via sysfs while requests are outstanding, those
> waiters never receive their completion callback and block indefinitely,
> leaking the request and its scatterlist buffers.
>
> Drain all three queues in mv_cesa_remove() and complete each remaining
> request with -ENOENT before freeing the IRQ, so bound tasks are released.
>
> Assisted-by: LLM
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
> drivers/crypto/marvell/cesa/cesa.c | 46 ++++++++++++++++++++++++++++++
> 1 file changed, 46 insertions(+)
Please check the Sashiko comments:
https://sashiko.dev/#/patchset/20260916230526.284982-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