From c014d35e7d88211a4c4d57fbd0b11c2442f2cc11 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 17 Oct 2022 14:43:52 +0300 Subject: [PATCH] qla2x00t-32gbit: Avoid flush_scheduled_work() usage Although qla2xxx driver is calling schedule_{,delayed}_work() from 10 locations, I assume that flush_scheduled_work() from qlt_stop_phase1() needs to flush only works scheduled by qlt_sched_sess_work(), for this loop continues while "struct qla_tgt"->sess_works_list is not empty. Link: https://lore.kernel.org/r/133c6723-90b6-5c8b-72b4-cc01eeb3a8c0@I-love.SAKURA.ne.jp Tested-by: Himanshu Madhani Reviewed-by: Himanshu Madhani Signed-off-by: Tetsuo Handa Signed-off-by: Martin K. Petersen [ commit 3cb0643a9aae upstream ] --- qla2x00t-32gbit/qla_target.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qla2x00t-32gbit/qla_target.c b/qla2x00t-32gbit/qla_target.c index 2c5e391ab..383cd931b 100644 --- a/qla2x00t-32gbit/qla_target.c +++ b/qla2x00t-32gbit/qla_target.c @@ -1574,7 +1574,7 @@ int qlt_stop_phase1(struct qla_tgt *tgt) spin_lock_irqsave(&tgt->sess_work_lock, flags); do { spin_unlock_irqrestore(&tgt->sess_work_lock, flags); - flush_scheduled_work(); + flush_work(&tgt->sess_work); spin_lock_irqsave(&tgt->sess_work_lock, flags); } while (!list_empty(&tgt->sess_works_list)); spin_unlock_irqrestore(&tgt->sess_work_lock, flags);