From nobody Mon Apr 6 10:46:25 2026 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 DE434C32771 for ; Sat, 24 Sep 2022 05:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233243AbiIXFLw (ORCPT ); Sat, 24 Sep 2022 01:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232776AbiIXFLs (ORCPT ); Sat, 24 Sep 2022 01:11:48 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6ACAB6576 for ; Fri, 23 Sep 2022 22:11:46 -0700 (PDT) Received: from fsav116.sakura.ne.jp (fsav116.sakura.ne.jp [27.133.134.243]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 28O5BWkv035721; Sat, 24 Sep 2022 14:11:32 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav116.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav116.sakura.ne.jp); Sat, 24 Sep 2022 14:11:32 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav116.sakura.ne.jp) Received: from [192.168.1.9] (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 28O5BO0R035679 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sat, 24 Sep 2022 14:11:32 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <0e8a2023-7526-f03a-f520-efafbb0ef45c@I-love.SAKURA.ne.jp> Date: Sat, 24 Sep 2022 14:11:25 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Content-Language: en-US To: Andrew Morton , LKML Cc: Matt Porter , Alexandre Bounine , Christophe JAILLET , Arnd Bergmann From: Tetsuo Handa Subject: [PATCH v3] rapidio/tsi721: Replace flush_scheduled_work() with flush_work(). Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Like commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue() using a macro") says, flush_scheduled_work() is dangerous and will be forbidden. We are on the way for removing all flush_scheduled_work() callers from the kernel, and this patch is for removing flush_scheduled_work() call from tsi721 driver. Since "struct tsi721_device" is per a device struct, I assume that tsi721_remove() needs to wait for only two works associated with that device. Therefore, wait for only these works using flush_work(). Signed-off-by: Tetsuo Handa --- Since no response from RAPIDIO SUBSYSTEM maintainers for more than three mo= nths ( https://lkml.kernel.org/r/ad924306-d15c-9f1e-13dc-eaf674878022@I-love.SAKUR= A.ne.jp https://lkml.kernel.org/r/8347375e-29fd-cd45-2b07-5504c9ddbd0c@I-love.SAKUR= A.ne.jp ), I route this patch to Andrew Morton. Changes in v3: Update description. Changes in v2: Use flush_work() instead of introducing a dedicated WQ. drivers/rapidio/devices/tsi721.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi= 721.c index b3134744fb55..0a42d6a2af24 100644 --- a/drivers/rapidio/devices/tsi721.c +++ b/drivers/rapidio/devices/tsi721.c @@ -2941,7 +2941,8 @@ static void tsi721_remove(struct pci_dev *pdev) =20 tsi721_disable_ints(priv); tsi721_free_irq(priv); - flush_scheduled_work(); + flush_work(&priv->idb_work); + flush_work(&priv->pw_work); rio_unregister_mport(&priv->mport); =20 tsi721_unregister_dma(priv); --=20 2.18.4