diff options
author | wangyangxin <wangyangxin1@huawei.com> | 2023-12-11 19:42:15 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-01-25 14:33:32 -0800 |
commit | 9cef719eefbc3956016f701cc026d7eb9834ffcb (patch) | |
tree | 991582249731dee9c84e0e19e003de0693acaa83 /drivers/crypto | |
parent | 3b333cded94fbe5ce30d699b316c4715151268ae (diff) | |
download | linux-stable-9cef719eefbc3956016f701cc026d7eb9834ffcb.tar.gz linux-stable-9cef719eefbc3956016f701cc026d7eb9834ffcb.tar.bz2 linux-stable-9cef719eefbc3956016f701cc026d7eb9834ffcb.zip |
crypto: virtio - Wait for tasklet to complete on device remove
[ Upstream commit 67cc511e8d436456cc98033e6d4ba83ebfc8e672 ]
The scheduled tasklet needs to be executed on device remove.
Fixes: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet")
Signed-off-by: wangyangxin <wangyangxin1@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/virtio/virtio_crypto_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/crypto/virtio/virtio_crypto_core.c b/drivers/crypto/virtio/virtio_crypto_core.c index c21770345f5f..2515a141c67b 100644 --- a/drivers/crypto/virtio/virtio_crypto_core.c +++ b/drivers/crypto/virtio/virtio_crypto_core.c @@ -446,11 +446,14 @@ 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"); 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); vdev->config->reset(vdev); virtcrypto_free_unused_reqs(vcrypto); virtcrypto_clear_crypto_engines(vcrypto); |