Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3914484rdb; Mon, 11 Dec 2023 04:02:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkbavm1PullcUrMk5GJe/urYWdJPRoPznVdxB4TOgv0PYPgC7gZ3wssbagykCtwd5mv8ej X-Received: by 2002:a05:6a00:a13:b0:6ce:4059:2300 with SMTP id p19-20020a056a000a1300b006ce40592300mr2067650pfh.27.1702296132220; Mon, 11 Dec 2023 04:02:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702296132; cv=none; d=google.com; s=arc-20160816; b=s88CfUZFWpGr5eJoasphIpk6Ih0LqXd4ThdC2GSvmA2E6QRZt7yQ7yS4p+1ycqvFkQ z2JYPgnaYPerLD6fTkT2XlKM16rJBBMtmNt3paMBkrnx/0TyK/hNMSecBFqBhoF0PykO /3WcRdoVl7Q3ChgaaLpVSixsoC/ZHfv5poEn6g6M9md+4ttstnNAI14JhgChmGrj3w5o LF5H+p6ZI5JmVeEeKGk7dluci0K1uq4Ad+JUEfanH4VtdSVNOUcHX+x8L+Fy0q0NRjeE Jsia+akHDBlRM194G23XD1FXkE5JsZHgQn21ccdnakrsgQwQokDI0ui7a3NHHoxLdyNy L6WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from; bh=T0XMVSEBLee3M/QZWiwpwTS9109WbXfFwe9womuk6y4=; fh=lF3870B4H3G4A487FoRcDxEPFNO7iSYLzi+mvzbRvV4=; b=F3kNOFddxoFjiOtBrDeT8VvorTlIISthtSukGiLcEWaafwFeIDPlY2CVCRFndPIIbD EoMqxkfVT9RwE6gi2mxSoPMvzJzBpiAiDnLoxZoI/HdwZKcRbgdqFHLi80d28PCX4DLR voB2cNDiVgykzQpP4f5x2jBvc0b/tV3Stw5b86tTOL61p6zMavrS2AbxmaUS/wvHOTlN 8L0OPo1tFyRRK49PR4wXAXBni5726xx/9j3HICV7L3fZp7X9YyDqwgrfpUbrOJW7zAU8 8waWrDAihjtRd4wtJGyEKi+5RaqBCdN8MD/CBEyu98xsA64NBGoUfeY9BytrrZEeVQEy Ku9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l5-20020a056a00140500b006cdf584699fsi6052592pfu.336.2023.12.11.04.02.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 04:02:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-695-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-crypto+bounces-695-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5DFCBB21360 for ; Mon, 11 Dec 2023 12:01:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4BC3C38F9A; Mon, 11 Dec 2023 12:01:28 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org X-Greylist: delayed 1136 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 11 Dec 2023 04:01:24 PST Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D585F3; Mon, 11 Dec 2023 04:01:24 -0800 (PST) Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Spfw35jl3z29fpt; Mon, 11 Dec 2023 19:41:23 +0800 (CST) Received: from dggpemm500006.china.huawei.com (unknown [7.185.36.236]) by mail.maildlp.com (Postfix) with ESMTPS id 90AF21A0178; Mon, 11 Dec 2023 19:42:29 +0800 (CST) Received: from DESKTOP-8LI8G6S.china.huawei.com (10.174.149.11) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 11 Dec 2023 19:42:29 +0800 From: Gonglei To: CC: , , , , , wangyangxin , Gonglei Subject: [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove Date: Mon, 11 Dec 2023 19:42:15 +0800 Message-ID: <1702294936-61080-2-git-send-email-arei.gonglei@huawei.com> X-Mailer: git-send-email 2.8.2.windows.1 In-Reply-To: <1702294936-61080-1-git-send-email-arei.gonglei@huawei.com> References: <1702294936-61080-1-git-send-email-arei.gonglei@huawei.com> Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) From: wangyangxin The scheduled tasklet needs to be executed on device remove. Fixes: fed93fb62e05 ("crypto: virtio - Handle dataq logic with tasklet") Signed-off-by: wangyangxin Signed-off-by: Gonglei --- 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