From patchwork Tue Feb 21 15:02:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tetsuo Handa X-Patchwork-Id: 13148032 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47505C61DA3 for ; Tue, 21 Feb 2023 15:03:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234683AbjBUPC7 (ORCPT ); Tue, 21 Feb 2023 10:02:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234653AbjBUPCx (ORCPT ); Tue, 21 Feb 2023 10:02:53 -0500 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B24A6597; Tue, 21 Feb 2023 07:02:52 -0800 (PST) Received: from fsav415.sakura.ne.jp (fsav415.sakura.ne.jp [133.242.250.114]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 31LF2mKS073435; Wed, 22 Feb 2023 00:02:48 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav415.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav415.sakura.ne.jp); Wed, 22 Feb 2023 00:02:48 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav415.sakura.ne.jp) Received: from [192.168.1.6] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 31LF2mkP073432 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Wed, 22 Feb 2023 00:02:48 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <0b9ebcfb-b647-1381-0653-b54528a64a86@I-love.SAKURA.ne.jp> Date: Wed, 22 Feb 2023 00:02:46 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani Cc: MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org, LKML From: Tetsuo Handa Subject: [PATCH] scsi: message: fusion: avoid flush_scheduled_work() usage Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org 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 --- 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); }