diff options
| author | Shengzhuo Wei <me@cherr.cc> | 2026-08-27 05:22:29 +0800 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-09-10 00:43:04 +0200 |
| commit | f0ff5673aa07ded2bb383ac526c1faee4fe9ca07 (patch) | |
| tree | e1b95184d350b851c6e336c280f9c6eecf4b1a92 | |
| parent | 2548e4fa576a87a3b0d1b15a9c3f909bc54887b5 (diff) | |
| download | linux-next-f0ff5673aa07ded2bb383ac526c1faee4fe9ca07.tar.gz linux-next-f0ff5673aa07ded2bb383ac526c1faee4fe9ca07.zip | |
power: supply: bq27xxx: synchronize work cancellation on suspend
The poll work requeues itself via mod_delayed_work() while the device
is not removed. cancel_delayed_work() does not wait for a callback
that is already running, so a poll racing with suspend can keep
issuing I2C transfers after suspend returns and requeue itself into
early resume.
Use cancel_delayed_work_sync() to quiesce polling before suspend
completes, as the teardown path already does.
Fixes: dfcb264a01a9 ("power: supply: bq27xxx: Stop and start delayed work in suspend and resume")
Cc: stable@vger.kernel.org
Signed-off-by: Shengzhuo Wei <me@cherr.cc>
Link: https://patch.msgid.link/20260827-bq27xxx-suspend-cancel-sync-v1-1-77a67711cbc3@cherr.cc
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| -rw-r--r-- | drivers/power/supply/bq27xxx_battery.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/bq27xxx_battery.c b/drivers/power/supply/bq27xxx_battery.c index 01c9ec1116fa..4d4809a70b62 100644 --- a/drivers/power/supply/bq27xxx_battery.c +++ b/drivers/power/supply/bq27xxx_battery.c @@ -2291,7 +2291,7 @@ static int bq27xxx_battery_suspend(struct device *dev) { struct bq27xxx_device_info *di = dev_get_drvdata(dev); - cancel_delayed_work(&di->work); + cancel_delayed_work_sync(&di->work); return 0; } |
