public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove and fix warnings
@ 2023-12-11 11:42 Gonglei
  2023-12-11 11:42 ` [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove Gonglei
  2023-12-11 11:42 ` [PATCH 2/2] crypto: virtio-crypto: Fix gcc check warnings Gonglei
  0 siblings, 2 replies; 5+ messages in thread
From: Gonglei @ 2023-12-11 11:42 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, mst, virtualization, linux-kernel, lixiao91,
	wangyangxin

From: wangyangxin <wangyangxin1@huawei.com>

This serie wait for tasklet to complete on device remove and fix gcc check warnings.

wangyangxin (2):
  crypto: virtio-crypto: Wait for tasklet to complete on device remove
  crypto: virtio-crypto: Fix gcc check warnings

 drivers/crypto/virtio/virtio_crypto_common.h | 5 ++---
 drivers/crypto/virtio/virtio_crypto_core.c   | 3 +++
 2 files changed, 5 insertions(+), 3 deletions(-)

-- 
2.33.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove
  2023-12-11 11:42 [PATCH 0/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove and fix warnings Gonglei
@ 2023-12-11 11:42 ` Gonglei
  2023-12-22  4:35   ` Herbert Xu
  2023-12-11 11:42 ` [PATCH 2/2] crypto: virtio-crypto: Fix gcc check warnings Gonglei
  1 sibling, 1 reply; 5+ messages in thread
From: Gonglei @ 2023-12-11 11:42 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, mst, virtualization, linux-kernel, lixiao91,
	wangyangxin, Gonglei

From: wangyangxin <wangyangxin1@huawei.com>

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>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] crypto: virtio-crypto: Fix gcc check warnings
  2023-12-11 11:42 [PATCH 0/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove and fix warnings Gonglei
  2023-12-11 11:42 ` [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove Gonglei
@ 2023-12-11 11:42 ` Gonglei
  2023-12-22  3:33   ` Herbert Xu
  1 sibling, 1 reply; 5+ messages in thread
From: Gonglei @ 2023-12-11 11:42 UTC (permalink / raw)
  To: herbert
  Cc: linux-crypto, mst, virtualization, linux-kernel, lixiao91,
	wangyangxin, Gonglei

From: wangyangxin <wangyangxin1@huawei.com>

Fix gcc check warnings in W=1 build mode.
Variable cpu not used when CONFIG_SMP not defined.

Fixes: dbaf0624ffa5 ("crypto: add virtio-crypto driver")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312040315.kPrI1OCE-lkp@int
el.com/
Signed-off-by: wangyangxin <wangyangxin1@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
 drivers/crypto/virtio/virtio_crypto_common.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/virtio/virtio_crypto_common.h b/drivers/crypto/virtio/virtio_crypto_common.h
index 7059bbe5a2eb..f0340bb7a10b 100644
--- a/drivers/crypto/virtio/virtio_crypto_common.h
+++ b/drivers/crypto/virtio/virtio_crypto_common.h
@@ -134,10 +134,9 @@ virtcrypto_clear_request(struct virtio_crypto_request *vc_req);
 
 static inline int virtio_crypto_get_current_node(void)
 {
-	int cpu, node;
+	int node;
 
-	cpu = get_cpu();
-	node = topology_physical_package_id(cpu);
+	node = topology_physical_package_id(get_cpu());
 	put_cpu();
 
 	return node;
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] crypto: virtio-crypto: Fix gcc check warnings
  2023-12-11 11:42 ` [PATCH 2/2] crypto: virtio-crypto: Fix gcc check warnings Gonglei
@ 2023-12-22  3:33   ` Herbert Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2023-12-22  3:33 UTC (permalink / raw)
  To: Gonglei
  Cc: linux-crypto, mst, virtualization, linux-kernel, lixiao91,
	wangyangxin

On Mon, Dec 11, 2023 at 07:42:16PM +0800, Gonglei wrote:
>
>  static inline int virtio_crypto_get_current_node(void)
>  {
> -	int cpu, node;
> +	int node;
>  
> -	cpu = get_cpu();
> -	node = topology_physical_package_id(cpu);
> +	node = topology_physical_package_id(get_cpu());

This looks like a bogus warning.  I think we should do something
like this instead:

diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
index ae81a7191c1c..0cb43986061b 100644
--- a/arch/x86/include/asm/processor.h
+++ b/arch/x86/include/asm/processor.h
@@ -191,7 +191,7 @@ DECLARE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info);
 #define cpu_data(cpu)		per_cpu(cpu_info, cpu)
 #else
 #define cpu_info		boot_cpu_data
-#define cpu_data(cpu)		boot_cpu_data
+#define cpu_data(cpu)		((void)cpu, boot_cpu_data)
 #endif
 
 extern const struct seq_operations cpuinfo_op;

Please send this patch to the x86 people.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove
  2023-12-11 11:42 ` [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove Gonglei
@ 2023-12-22  4:35   ` Herbert Xu
  0 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2023-12-22  4:35 UTC (permalink / raw)
  To: Gonglei
  Cc: linux-crypto, mst, virtualization, linux-kernel, lixiao91,
	wangyangxin

On Mon, Dec 11, 2023 at 07:42:15PM +0800, Gonglei wrote:
> From: wangyangxin <wangyangxin1@huawei.com>
> 
> 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>
> ---
>  drivers/crypto/virtio/virtio_crypto_core.c | 3 +++
>  1 file changed, 3 insertions(+)

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-12-22  4:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-11 11:42 [PATCH 0/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove and fix warnings Gonglei
2023-12-11 11:42 ` [PATCH 1/2] crypto: virtio-crypto: Wait for tasklet to complete on device remove Gonglei
2023-12-22  4:35   ` Herbert Xu
2023-12-11 11:42 ` [PATCH 2/2] crypto: virtio-crypto: Fix gcc check warnings Gonglei
2023-12-22  3:33   ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox