* [PATCH] power: supply: isp1704_charger: cancel work on remove
@ 2026-07-28 12:33 Hongyan Xu
2026-07-30 22:04 ` Sebastian Reichel
0 siblings, 1 reply; 3+ messages in thread
From: Hongyan Xu @ 2026-07-28 12:33 UTC (permalink / raw)
To: pali, sre; +Cc: Hongyan Xu, linux-pm, linux-kernel, jianhao.xu
The USB notifier and initial VBUS detection can schedule isp->work. The
remove path unregisters the notifier and power supply, but does not wait
for queued or running work before tearing down the power supply state.
Cancel the work after unregistering the notifier. Do this before
unregistering the power supply.
This issue was found by a static analysis tool.
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
---
drivers/power/supply/isp1704_charger.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/power/supply/isp1704_charger.c b/drivers/power/supply/isp1704_charger.c
index 237912a92..e329321d0 100644
--- a/drivers/power/supply/isp1704_charger.c
+++ b/drivers/power/supply/isp1704_charger.c
@@ -482,6 +482,7 @@ static void isp1704_charger_remove(struct platform_device *pdev)
struct isp1704_charger *isp = platform_get_drvdata(pdev);
usb_unregister_notifier(isp->phy, &isp->nb);
+ cancel_work_sync(&isp->work);
power_supply_unregister(isp->psy);
isp1704_charger_set_power(isp, 0);
}
--
2.50.1.windows.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] power: supply: isp1704_charger: cancel work on remove
2026-07-28 12:33 [PATCH] power: supply: isp1704_charger: cancel work on remove Hongyan Xu
@ 2026-07-30 22:04 ` Sebastian Reichel
2026-07-30 23:41 ` Sebastian Reichel
0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Reichel @ 2026-07-30 22:04 UTC (permalink / raw)
To: pali, sre, Hongyan Xu; +Cc: linux-pm, linux-kernel, jianhao.xu
On Tue, 28 Jul 2026 20:33:39 +0800, Hongyan Xu wrote:
> The USB notifier and initial VBUS detection can schedule isp->work. The
> remove path unregisters the notifier and power supply, but does not wait
> for queued or running work before tearing down the power supply state.
>
> Cancel the work after unregistering the notifier. Do this before
> unregistering the power supply.
>
> [...]
Applied, thanks!
[1/1] power: supply: isp1704_charger: cancel work on remove
commit: 60c5b8a9ef4dbc5d69bbc1a960fe55826cb3b643
Best regards,
--
Sebastian Reichel <sebastian.reichel@collabora.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] power: supply: isp1704_charger: cancel work on remove
2026-07-30 22:04 ` Sebastian Reichel
@ 2026-07-30 23:41 ` Sebastian Reichel
0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Reichel @ 2026-07-30 23:41 UTC (permalink / raw)
To: pali, Hongyan Xu; +Cc: linux-pm, linux-kernel, jianhao.xu
[-- Attachment #1: Type: text/plain, Size: 864 bytes --]
Hi,
On Fri, Jul 31, 2026 at 12:04:31AM +0200, Sebastian Reichel wrote:
> On Tue, 28 Jul 2026 20:33:39 +0800, Hongyan Xu wrote:
> > The USB notifier and initial VBUS detection can schedule isp->work. The
> > remove path unregisters the notifier and power supply, but does not wait
> > for queued or running work before tearing down the power supply state.
> >
> > Cancel the work after unregistering the notifier. Do this before
> > unregistering the power supply.
> >
> > [...]
>
> Applied, thanks!
>
> [1/1] power: supply: isp1704_charger: cancel work on remove
> commit: 60c5b8a9ef4dbc5d69bbc1a960fe55826cb3b643
I've added a Fixes tag while applying. But considering nobody cared
in the last 15 years (bug was in this driver since it exists), it
goes the normal route through the next merge window.
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-30 23:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-28 12:33 [PATCH] power: supply: isp1704_charger: cancel work on remove Hongyan Xu
2026-07-30 22:04 ` Sebastian Reichel
2026-07-30 23:41 ` Sebastian Reichel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox