Re: [PATCH] power: supply: bq27xxx: Ensure poll work is cancelled on remove

From: Sebastian Reichel

Date: Wed Sep 09 2026 - 17:05:58 EST



On Thu, 03 Sep 2026 08:13:12 +0000, Fan Wu wrote:
> The di->work poll work is queued from the poll callback itself and from
> bq27xxx_external_power_changed(). The cancel_delayed_work_sync() in
> bq27xxx_battery_teardown() runs while the power_supply is still
> registered, so external_power_changed() can re-arm the work after the
> cancel, and it runs after the driver data has been freed.
>
> Register a devm_delayed_work_autocancel() before
> devm_power_supply_register(), so on unwind the power_supply is
> unregistered first, after which no new external_power_changed()
> callback can be dispatched, and the poll work is cancelled only then.
> Drop the now-redundant cancel from bq27xxx_battery_teardown().
>
> [...]

Applied, thanks!

[1/1] power: supply: bq27xxx: Ensure poll work is cancelled on remove
commit: b90fd101324ca12494a65bd8d2e749883551962d

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