All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: linux-rtc@vger.kernel.org
Subject: [PATCH v4] rtc: Replace flush_scheduled_work() with flush_work().
Date: Fri, 10 Jun 2022 19:48:36 +0900	[thread overview]
Message-ID: <8d3a0f55-d861-ba93-0d25-b1172eaa8343@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <Yoe/oPW8MFZ02fEn@mail.local>

Since "struct rtc_device" is per a device struct, I assume that clear_uie()
needs to wait for only one work associated with that device. Therefore,
wait for only that work using flush_work().

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
---
Please see commit c4f135d643823a86 ("workqueue: Wrap flush_workqueue()
using a macro") for background.

Changes in v4:
  Use flush_work() instead of introducing a dedicated WQ.

 drivers/rtc/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/dev.c b/drivers/rtc/dev.c
index 69325aeede1a..5cf90daf975c 100644
--- a/drivers/rtc/dev.c
+++ b/drivers/rtc/dev.c
@@ -96,7 +96,7 @@ static int clear_uie(struct rtc_device *rtc)
 		}
 		if (rtc->uie_task_active) {
 			spin_unlock_irq(&rtc->irq_lock);
-			flush_scheduled_work();
+			flush_work(&rtc->uie_task);
 			spin_lock_irq(&rtc->irq_lock);
 		}
 		rtc->uie_irq_active = 0;
-- 
2.18.4



  reply	other threads:[~2022-06-10 10:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 14:27 [PATCH] rtc: Avoid flush_scheduled_work() usage Tetsuo Handa
2022-04-30 10:25 ` [PATCH v2] " Tetsuo Handa
2022-05-17  4:14   ` Tetsuo Handa
2022-05-20 14:33   ` [PATCH v3] " Tetsuo Handa
2022-05-20 16:19     ` Alexandre Belloni
2022-06-10 10:48       ` Tetsuo Handa [this message]
2022-06-24 17:14         ` [PATCH v4] rtc: Replace flush_scheduled_work() with flush_work() Alexandre Belloni

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=8d3a0f55-d861-ba93-0d25-b1172eaa8343@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-rtc@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.