linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events
@ 2024-12-21 16:10 Sicelo A. Mhlongo
  2024-12-23  2:28 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Sicelo A. Mhlongo @ 2024-12-21 16:10 UTC (permalink / raw)
  To: linux-pm
  Cc: Sebastian Reichel, pali, linux-kernel, Ivaylo Dimitrov,
	Sicelo A. Mhlongo

When the notifier is called we want to schedule the worker as
soon as possible. Thus it makes sense to reschedule any waiting
work and only queue a new one if there is none.

Suggested-by: Ivaylo Dimitrov <ivo.g.dimitrov.75@gmail.com>
Signed-off-by: Sicelo A. Mhlongo <absicsz@gmail.com>
---
 * Changes from v1:
   - Reworded the commit description per comments from v1 review

 drivers/power/supply/bq2415x_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq2415x_charger.c b/drivers/power/supply/bq2415x_charger.c
index 18a6c3dbc758..22f6a3b71632 100644
--- a/drivers/power/supply/bq2415x_charger.c
+++ b/drivers/power/supply/bq2415x_charger.c
@@ -842,7 +842,7 @@ static int bq2415x_notifier_call(struct notifier_block *nb,
 	if (bq->automode < 1)
 		return NOTIFY_OK;
 
-	schedule_delayed_work(&bq->work, 0);
+	mod_delayed_work(system_wq, &bq->work, 0);
 
 	return NOTIFY_OK;
 }
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events
  2024-12-21 16:10 [PATCH v2] power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events Sicelo A. Mhlongo
@ 2024-12-23  2:28 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2024-12-23  2:28 UTC (permalink / raw)
  To: linux-pm, Sicelo A. Mhlongo; +Cc: pali, linux-kernel, Ivaylo Dimitrov


On Sat, 21 Dec 2024 18:10:23 +0200, Sicelo A. Mhlongo wrote:
> When the notifier is called we want to schedule the worker as
> soon as possible. Thus it makes sense to reschedule any waiting
> work and only queue a new one if there is none.
> 
> 

Applied, thanks!

[1/1] power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events
      commit: f6945d52ee5346900fb7251ec23d34822a06918e

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-23  2:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-21 16:10 [PATCH v2] power: supply: bq2415x_charger: Immediately reschedule delayed work on notifier events Sicelo A. Mhlongo
2024-12-23  2:28 ` Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).