public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: message: fusion: avoid flush_scheduled_work() usage
@ 2023-02-21 15:02 Tetsuo Handa
  2023-03-07  3:03 ` Martin K. Petersen
  2023-03-10  3:14 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Tetsuo Handa @ 2023-02-21 15:02 UTC (permalink / raw)
  To: Sathya Prakash, Sreekanth Reddy, Suganath Prabu Subramani
  Cc: MPT-FusionLinux.pdl, linux-scsi, LKML

Like commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue() using a
macro") says, flush_scheduled_work() is dangerous and will be forbidden.

Commit 4d4109d0eb69 ("[SCSI] mpt fusion: Power Management fixes for MPT
SAS PCI-E controllers") added flush_scheduled_work() call into
mptscsih_suspend(). As of commit 4d4109d0eb69, there were several
schedule{,_delayed}_work() calls where flush_scheduled_work() from
mptscsih_suspend() meant to wait for completion, but which work items
is this flush_scheduled_work() call for was not explained.

Then, schedule_work("struct mptsas_hotplug_event"->work) and
schedule_work(MPT_ADAPTER->sas_persist_task) has been removed by
commit 3eb0822c6740 ("[SCSI] mpt fusion: Firmware event implementation
using seperate WorkQueue"), and
schedule_work("struct mptsas_send_discovery_event"->work) has been
removed by commit f9c34022eae9 ("[SCSI] mpt fusion: SAS topology scan
changes, expander events").

There still remains schedule_work("struct work_queue_wrapper"->work) call
in mptspi.c and schedule_delayed_work("struct mpt_lan_priv"->work) call in
mptlan.c , but I guess that these are not work items which
commit 4d4109d0eb69 meant to wait for completion because these are not per
MPT_ADAPTER work items. If my guess is correct, we no longer need to call
flush_scheduled_work() from mptscsih_suspend().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
 drivers/message/fusion/mptscsih.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index 276084ed04a6..2bc17087d17d 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1231,7 +1231,6 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
 	MPT_ADAPTER 		*ioc = pci_get_drvdata(pdev);
 
 	scsi_block_requests(ioc->sh);
-	flush_scheduled_work();
 	mptscsih_shutdown(pdev);
 	return mpt_suspend(pdev,state);
 }
-- 
2.18.4

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

end of thread, other threads:[~2023-03-10  3:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-21 15:02 [PATCH] scsi: message: fusion: avoid flush_scheduled_work() usage Tetsuo Handa
2023-03-07  3:03 ` Martin K. Petersen
2023-03-10  3:14 ` Martin K. Petersen

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