2022-01-27 09:03:54

by CGEL

[permalink] [raw]
Subject: [PATCH] qedi: Remove redundant 'flush_workqueue()' calls

From: "Minghao Chi (CGEL ZTE)" <[email protected]>

'destroy_workqueue()' already drains the queue before destroying it, so
there is no need to flush it explicitly.

Remove the redundant 'flush_workqueue()' calls.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Minghao Chi (CGEL ZTE) <[email protected]>
Signed-off-by: CGEL ZTE <[email protected]>
---
drivers/scsi/qedi/qedi_main.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
index 832a856dd367..83ffba7f51da 100644
--- a/drivers/scsi/qedi/qedi_main.c
+++ b/drivers/scsi/qedi/qedi_main.c
@@ -2418,13 +2418,11 @@ static void __qedi_remove(struct pci_dev *pdev, int mode)
iscsi_host_remove(qedi->shost);

if (qedi->tmf_thread) {
- flush_workqueue(qedi->tmf_thread);
destroy_workqueue(qedi->tmf_thread);
qedi->tmf_thread = NULL;
}

if (qedi->offload_thread) {
- flush_workqueue(qedi->offload_thread);
destroy_workqueue(qedi->offload_thread);
qedi->offload_thread = NULL;
}
--
2.25.1


2022-02-08 01:07:47

by Manish Rangankar

[permalink] [raw]
Subject: RE: [EXT] [PATCH] qedi: Remove redundant 'flush_workqueue()' calls


> -----Original Message-----
> From: [email protected] <[email protected]>
> Sent: Thursday, January 27, 2022 7:10 AM
> To: Nilesh Javali <[email protected]>
> Cc: Manish Rangankar <[email protected]>; GR-QLogic-Storage-
> Upstream <[email protected]>; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; Minghao Chi (CGEL ZTE) <[email protected]>;
> Zeal Robot <[email protected]>; CGEL ZTE <[email protected]>
> Subject: [EXT] [PATCH] qedi: Remove redundant 'flush_workqueue()' calls
>
> External Email
>
> ----------------------------------------------------------------------
> From: "Minghao Chi (CGEL ZTE)" <[email protected]>
>
> 'destroy_workqueue()' already drains the queue before destroying it, so there is
> no need to flush it explicitly.
>
> Remove the redundant 'flush_workqueue()' calls.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Minghao Chi (CGEL ZTE) <[email protected]>
> Signed-off-by: CGEL ZTE <[email protected]>
> ---
> drivers/scsi/qedi/qedi_main.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index
> 832a856dd367..83ffba7f51da 100644
> --- a/drivers/scsi/qedi/qedi_main.c
> +++ b/drivers/scsi/qedi/qedi_main.c
> @@ -2418,13 +2418,11 @@ static void __qedi_remove(struct pci_dev *pdev,
> int mode)
> iscsi_host_remove(qedi->shost);
>
> if (qedi->tmf_thread) {
> - flush_workqueue(qedi->tmf_thread);
> destroy_workqueue(qedi->tmf_thread);
> qedi->tmf_thread = NULL;
> }
>
> if (qedi->offload_thread) {
> - flush_workqueue(qedi->offload_thread);
> destroy_workqueue(qedi->offload_thread);
> qedi->offload_thread = NULL;
> }

Thanks,

Acked-by: Manish Rangankar <[email protected]>

2022-02-08 13:16:40

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH] qedi: Remove redundant 'flush_workqueue()' calls

On Thu, 27 Jan 2022 01:39:34 +0000, [email protected] wrote:

> From: "Minghao Chi (CGEL ZTE)" <[email protected]>
>
> 'destroy_workqueue()' already drains the queue before destroying it, so
> there is no need to flush it explicitly.
>
> Remove the redundant 'flush_workqueue()' calls.
>
> [...]

Applied to 5.18/scsi-queue, thanks!

[1/1] qedi: Remove redundant 'flush_workqueue()' calls
https://git.kernel.org/mkp/scsi/c/0603be719237

--
Martin K. Petersen Oracle Linux Engineering