Commit 67cc511e authored by wangyangxin's avatar wangyangxin Committed by Herbert Xu
Browse files

crypto: virtio - Wait for tasklet to complete on device remove



The scheduled tasklet needs to be executed on device remove.

Fixes: fed93fb6 ("crypto: virtio - Handle dataq logic with tasklet")
Signed-off-by: default avatarwangyangxin <wangyangxin1@huawei.com>
Signed-off-by: default avatarGonglei <arei.gonglei@huawei.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent c480a421
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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);