[PATCH 10/10] power: supply: sbs-battery: Always cancel delayed work on suspend

From: Lee Jones

Date: Thu Dec 03 2026 - 11:14:45 EST


sbs_external_power_changed() schedules chip->work unconditionally, even
when chip->poll_retry_count (and therefore chip->poll_time) is 0, and
the final retry in sbs_delayed_work() also leaves chip->poll_time at 0
while chip->work is pending. Guarding cancel_delayed_work_sync() with
chip->poll_time > 0 in sbs_suspend() allows sbs_delayed_work() to issue
I2C transfers over a suspended bus.

Unconditionally cancel chip->work in sbs_suspend().

Fixes: 58ddafae2d71 ("bq20z75: Add support for external notification")
Closes: https://sashiko.dev/#/bug/linux-cf247db7-fc5a-40ee-b341-0d7814f58458
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
drivers/power/supply/sbs-battery.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index f8b194c58a62..0b68f9835719 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -1253,8 +1253,7 @@ static int sbs_suspend(struct device *dev)
struct sbs_info *chip = i2c_get_clientdata(client);
int ret;

- if (chip->poll_time > 0)
- cancel_delayed_work_sync(&chip->work);
+ cancel_delayed_work_sync(&chip->work);

if (chip->flags & SBS_FLAGS_TI_BQ20ZX5) {
/* Write to manufacturer access with sleep command. */
--
2.56.1.911.g883d8bcb20-goog