2023-12-11 12:02:12

by Gonglei (Arei)

[permalink] [raw]
Subject: [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove

From: wangyangxin <[email protected]>

The scheduled tasklet needs to be executed on device remove.

Fixes: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
Signed-off-by: wangyangxin <[email protected]>
Signed-off-by: Gonglei <[email protected]>
---
drivers/crypto/virtio/virtio_crypto_core.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c
index 428d76562447..b909c6a2bf1c 100644
--- a/drivers/crypto/virtio/virtio_crypto_core.c
+++ b/drivers/crypto/virtio/virtio_crypto_core.c
@@ -500,12 +500,15 @@ static void virtcrypto_free_unused_reqs(struct virtio_crypto *vcrypto)
static void virtcrypto_remove(struct virtio_device *vdev)
{
struct virtio_crypto *vcrypto = vdev->priv;
+ int i;

dev_info(&vdev->dev, "Start virtcrypto_remove.\n");

flush_work(&vcrypto->config_work);
if (virtcrypto_dev_started(vcrypto))
virtcrypto_dev_stop(vcrypto);
+ for (i = 0; i < vcrypto->max_data_queues; i++)
+ tasklet_kill(&vcrypto->data_vq[i].done_task);
virtio_reset_device(vdev);
virtcrypto_free_unused_reqs(vcrypto);
virtcrypto_clear_crypto_engines(vcrypto);
--
2.33.0



2023-12-22 04:35:24

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove

On Mon, Dec 11, 2023 at 07:42:15PM +0800, Gonglei wrote:
> From: wangyangxin <[email protected]>
>
> The scheduled tasklet needs to be executed on device remove.
>
> Fixes: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
> Signed-off-by: wangyangxin <[email protected]>
> Signed-off-by: Gonglei <[email protected]>
> ---
> drivers/crypto/virtio/virtio_crypto_core.c | 3 +++
> 1 file changed, 3 insertions(+)

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