From: Andrew Morton <akpm@linux-foundation.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: LKML <linux-kernel@vger.kernel.org>,
Matt Porter <mporter@kernel.crashing.org>,
Alexandre Bounine <alex.bou9@gmail.com>,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v3] rapidio/tsi721: Replace flush_scheduled_work() with flush_work().
Date: Sun, 25 Sep 2022 10:27:42 -0700 [thread overview]
Message-ID: <20220925102742.84ccc07ce1e8e591e4d5ce0f@linux-foundation.org> (raw)
In-Reply-To: <0e8a2023-7526-f03a-f520-efafbb0ef45c@I-love.SAKURA.ne.jp>
On Sat, 24 Sep 2022 14:11:25 +0900 Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> wrote:
> 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().
>
> --- a/drivers/rapidio/devices/tsi721.c
> +++ b/drivers/rapidio/devices/tsi721.c
> @@ -2941,7 +2941,8 @@ static void tsi721_remove(struct pci_dev *pdev)
>
> 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);
Why not use cancel_work[_sync](), as the flush_scheduled_work() comment
recommends?
next prev parent reply other threads:[~2022-09-25 17:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-24 5:11 Tetsuo Handa
2022-09-25 17:27 ` Andrew Morton [this message]
2022-09-26 10:28 ` Tetsuo Handa
2022-09-26 15:06 ` Alan Stern
2022-09-26 22:13 ` Tetsuo Handa
2022-10-10 10:16 ` Tetsuo Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220925102742.84ccc07ce1e8e591e4d5ce0f@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=alex.bou9@gmail.com \
--cc=arnd@arndb.de \
--cc=christophe.jaillet@wanadoo.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=mporter@kernel.crashing.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®