* [PATCH 0/2] mfd: freeze delayed I/O work during suspend
@ 2026-10-16 10:05 Jiale Yao
2026-10-16 10:05 ` [PATCH 1/2] mfd: si476x: queue polling work on freezable workqueue Jiale Yao
2026-10-16 10:05 ` [PATCH 2/2] mfd: tps65010: queue I/O " Jiale Yao
0 siblings, 2 replies; 5+ messages in thread
From: Jiale Yao @ 2026-10-16 10:05 UTC (permalink / raw)
To: Lee Jones, mfd, linux-kernel; +Cc: Jiale Yao
The SI476x polling callback and TPS65010 event worker issue I2C transfers
from delayed work. Their current workqueues remain active while devices are
being suspended, allowing pending callbacks to reach an already suspended
I2C adapter.
Move both callbacks to freezable workqueues. Preserve the TPS65010 worker's
power-efficient property by using system_freezable_power_efficient_wq.
Each patch is independent and can be applied separately.
Jiale Yao (2):
mfd: si476x: queue polling work on freezable workqueue
mfd: tps65010: queue I/O work on freezable workqueue
drivers/mfd/si476x-i2c.c | 5 +++--
drivers/mfd/tps65010.c | 10 +++++-----
2 files changed, 8 insertions(+), 7 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] mfd: si476x: queue polling work on freezable workqueue
2026-10-16 10:05 [PATCH 0/2] mfd: freeze delayed I/O work during suspend Jiale Yao
@ 2026-10-16 10:05 ` Jiale Yao
2026-10-17 7:19 ` jiale yao
2026-10-16 10:05 ` [PATCH 2/2] mfd: tps65010: queue I/O " Jiale Yao
1 sibling, 1 reply; 5+ messages in thread
From: Jiale Yao @ 2026-10-16 10:05 UTC (permalink / raw)
To: Lee Jones, mfd, linux-kernel; +Cc: Jiale Yao
SI476x devices without an interrupt continuously poll their status over
I2C. The polling callback runs on the non-freezable system workqueue and
can issue a transfer after the adapter has been suspended.
Queue status polling on system_freezable_wq so it stops before device
suspend and continues after resume.
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/mfd/si476x-i2c.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/si476x-i2c.c b/drivers/mfd/si476x-i2c.c
index 9bce720a0a08..8d952113f8a6 100644
--- a/drivers/mfd/si476x-i2c.c
+++ b/drivers/mfd/si476x-i2c.c
@@ -17,6 +17,7 @@
#include <linux/regulator/consumer.h>
#include <linux/i2c.h>
#include <linux/err.h>
+#include <linux/workqueue.h>
#include <linux/mfd/si476x-core.h>
@@ -97,8 +98,8 @@ static int si476x_core_config_pinmux(struct si476x_core *core)
static inline void si476x_core_schedule_polling_work(struct si476x_core *core)
{
- schedule_delayed_work(&core->status_monitor,
- usecs_to_jiffies(SI476X_STATUS_POLL_US));
+ queue_delayed_work(system_freezable_wq, &core->status_monitor,
+ usecs_to_jiffies(SI476X_STATUS_POLL_US));
}
/**
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] mfd: tps65010: queue I/O work on freezable workqueue
2026-10-16 10:05 [PATCH 0/2] mfd: freeze delayed I/O work during suspend Jiale Yao
2026-10-16 10:05 ` [PATCH 1/2] mfd: si476x: queue polling work on freezable workqueue Jiale Yao
@ 2026-10-16 10:05 ` Jiale Yao
2026-10-17 7:20 ` jiale yao
1 sibling, 1 reply; 5+ messages in thread
From: Jiale Yao @ 2026-10-16 10:05 UTC (permalink / raw)
To: Lee Jones, mfd, linux-kernel; +Cc: Jiale Yao
The TPS65010 event worker performs SMBus transfers and can reschedule
itself to poll the charging state. The power-efficient system workqueue
is not freezable, so pending work can access an I2C adapter after it has
been suspended.
Use the freezable power-efficient workqueue for every scheduling path.
This preserves the power-efficient behavior while freezing I/O across
system suspend.
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
drivers/mfd/tps65010.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c
index 8a144ec52201..b038d67ff715 100644
--- a/drivers/mfd/tps65010.c
+++ b/drivers/mfd/tps65010.c
@@ -230,7 +230,7 @@ static int dbg_show(struct seq_file *s, void *_)
seq_printf(s, "mask2 %s\n", buf);
/* ignore ackint2 */
- queue_delayed_work(system_power_efficient_wq, &tps->work,
+ queue_delayed_work(system_freezable_power_efficient_wq, &tps->work,
POWER_POLL_DELAY);
/* VMAIN voltage, enable lowpower, etc */
@@ -388,7 +388,7 @@ static void tps65010_interrupt(struct tps65010 *tps)
&& (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC)))
poll = 1;
if (poll)
- queue_delayed_work(system_power_efficient_wq, &tps->work,
+ queue_delayed_work(system_freezable_power_efficient_wq, &tps->work,
POWER_POLL_DELAY);
/* also potentially gpio-in rise or fall */
@@ -436,7 +436,7 @@ static irqreturn_t tps65010_irq(int irq, void *_tps)
disable_irq_nosync(irq);
set_bit(FLAG_IRQ_ENABLE, &tps->flags);
- queue_delayed_work(system_power_efficient_wq, &tps->work, 0);
+ queue_delayed_work(system_freezable_power_efficient_wq, &tps->work, 0);
return IRQ_HANDLED;
}
@@ -694,7 +694,8 @@ int tps65010_set_vbus_draw(unsigned mA)
&& test_and_set_bit(
FLAG_VBUS_CHANGED, &the_tps->flags)) {
/* gadget drivers call this in_irq() */
- queue_delayed_work(system_power_efficient_wq, &the_tps->work,
+ queue_delayed_work(system_freezable_power_efficient_wq,
+ &the_tps->work,
0);
}
local_irq_restore(flags);
@@ -1052,4 +1053,3 @@ static void __exit tps_exit(void)
i2c_del_driver(&tps65010_driver);
}
module_exit(tps_exit);
-
--
2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re:[PATCH 1/2] mfd: si476x: queue polling work on freezable workqueue
2026-10-16 10:05 ` [PATCH 1/2] mfd: si476x: queue polling work on freezable workqueue Jiale Yao
@ 2026-10-17 7:19 ` jiale yao
0 siblings, 0 replies; 5+ messages in thread
From: jiale yao @ 2026-10-17 7:19 UTC (permalink / raw)
To: Lee Jones, mfd, linux-kernel
At 2026-10-16 18:05:02, "Jiale Yao" <yaojiale02@163.com> wrote:
>SI476x devices without an interrupt continuously poll their status over
>I2C. The polling callback runs on the non-freezable system workqueue and
>can issue a transfer after the adapter has been suspended.
>
>Queue status polling on system_freezable_wq so it stops before device
>suspend and continues after resume.
>
Fixes: 730a30ab7fba ("mfd: si476x: Add the bulk of the core driver")
>Signed-off-by: Jiale Yao <yaojiale02@163.com>
>---
> drivers/mfd/si476x-i2c.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/mfd/si476x-i2c.c b/drivers/mfd/si476x-i2c.c
>index 9bce720a0a08..8d952113f8a6 100644
>--- a/drivers/mfd/si476x-i2c.c
>+++ b/drivers/mfd/si476x-i2c.c
>@@ -17,6 +17,7 @@
> #include <linux/regulator/consumer.h>
> #include <linux/i2c.h>
> #include <linux/err.h>
>+#include <linux/workqueue.h>
>
> #include <linux/mfd/si476x-core.h>
>
>@@ -97,8 +98,8 @@ static int si476x_core_config_pinmux(struct si476x_core *core)
>
> static inline void si476x_core_schedule_polling_work(struct si476x_core *core)
> {
>- schedule_delayed_work(&core->status_monitor,
>- usecs_to_jiffies(SI476X_STATUS_POLL_US));
>+ queue_delayed_work(system_freezable_wq, &core->status_monitor,
>+ usecs_to_jiffies(SI476X_STATUS_POLL_US));
> }
>
> /**
>--
>2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re:[PATCH 2/2] mfd: tps65010: queue I/O work on freezable workqueue
2026-10-16 10:05 ` [PATCH 2/2] mfd: tps65010: queue I/O " Jiale Yao
@ 2026-10-17 7:20 ` jiale yao
0 siblings, 0 replies; 5+ messages in thread
From: jiale yao @ 2026-10-17 7:20 UTC (permalink / raw)
To: Lee Jones, mfd, linux-kernel
At 2026-10-16 18:05:03, "Jiale Yao" <yaojiale02@163.com> wrote:
>The TPS65010 event worker performs SMBus transfers and can reschedule
>itself to poll the charging state. The power-efficient system workqueue
>is not freezable, so pending work can access an I2C adapter after it has
>been suspended.
>
>Use the freezable power-efficient workqueue for every scheduling path.
>This preserves the power-efficient behavior while freezing I/O across
>system suspend.
>
Fixes: 72cd799544f2 ("[PATCH] I2C: add i2c driver for TPS6501x")
>Signed-off-by: Jiale Yao <yaojiale02@163.com>
>---
> drivers/mfd/tps65010.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
>diff --git a/drivers/mfd/tps65010.c b/drivers/mfd/tps65010.c
>index 8a144ec52201..b038d67ff715 100644
>--- a/drivers/mfd/tps65010.c
>+++ b/drivers/mfd/tps65010.c
>@@ -230,7 +230,7 @@ static int dbg_show(struct seq_file *s, void *_)
> seq_printf(s, "mask2 %s\n", buf);
> /* ignore ackint2 */
>
>- queue_delayed_work(system_power_efficient_wq, &tps->work,
>+ queue_delayed_work(system_freezable_power_efficient_wq, &tps->work,
> POWER_POLL_DELAY);
>
> /* VMAIN voltage, enable lowpower, etc */
>@@ -388,7 +388,7 @@ static void tps65010_interrupt(struct tps65010 *tps)
> && (tps->chgstatus & (TPS_CHG_USB|TPS_CHG_AC)))
> poll = 1;
> if (poll)
>- queue_delayed_work(system_power_efficient_wq, &tps->work,
>+ queue_delayed_work(system_freezable_power_efficient_wq, &tps->work,
> POWER_POLL_DELAY);
>
> /* also potentially gpio-in rise or fall */
>@@ -436,7 +436,7 @@ static irqreturn_t tps65010_irq(int irq, void *_tps)
>
> disable_irq_nosync(irq);
> set_bit(FLAG_IRQ_ENABLE, &tps->flags);
>- queue_delayed_work(system_power_efficient_wq, &tps->work, 0);
>+ queue_delayed_work(system_freezable_power_efficient_wq, &tps->work, 0);
> return IRQ_HANDLED;
> }
>
>@@ -694,7 +694,8 @@ int tps65010_set_vbus_draw(unsigned mA)
> && test_and_set_bit(
> FLAG_VBUS_CHANGED, &the_tps->flags)) {
> /* gadget drivers call this in_irq() */
>- queue_delayed_work(system_power_efficient_wq, &the_tps->work,
>+ queue_delayed_work(system_freezable_power_efficient_wq,
>+ &the_tps->work,
> 0);
> }
> local_irq_restore(flags);
>@@ -1052,4 +1053,3 @@ static void __exit tps_exit(void)
> i2c_del_driver(&tps65010_driver);
> }
> module_exit(tps_exit);
>-
>--
>2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-10-17 7:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 10:05 [PATCH 0/2] mfd: freeze delayed I/O work during suspend Jiale Yao
2026-10-16 10:05 ` [PATCH 1/2] mfd: si476x: queue polling work on freezable workqueue Jiale Yao
2026-10-17 7:19 ` jiale yao
2026-10-16 10:05 ` [PATCH 2/2] mfd: tps65010: queue I/O " Jiale Yao
2026-10-17 7:20 ` jiale yao
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®