Re: [PATCH] media: i2c: hi556: fix power leak on remove while runtime-active
From: Sakari Ailus
Date: Mon Sep 28 2026 - 10:45:28 EST
Hi Cong,
Thanks for the patches.
On Mon, Sep 28, 2026 at 08:51:40PM +0700, Cong Nguyen wrote:
> hi556_remove() calls pm_runtime_disable() but never hi556_suspend().
> pm_runtime_disable() only blocks future auto suspend/resume, it
> doesn't force a final one -- if unbound while hi556_set_stream() is
> holding an outstanding PM reference (removed while still streaming),
> the device stays genuinely active with regulators/clock enabled
> forever after.
>
> probe()'s own error path already shows the right pairing (calls
> hi556_suspend() when powered on). Do the same in remove(), guarded by
> pm_runtime_status_suspended() so the common already-suspended case
> isn't suspended twice -- same guard sibling imx412.c's remove() uses.
>
> Moved remove() after suspend()/resume()'s definitions since it now
> calls them directly.
A few notes on this as the rest:
- The quality of this commit message needs to be improved.
- When you're sending a bunch of similar patches, please send them in a
single patchset.
- When moving functions around and then making changes to them, please do
this in two separate patches.
- If the device's PM runtime status isn't SUSPENDED in remove(), it needs
to be set SUSPENDED using pm_runtime_set_suspended(). Please do this
while making other PM runtime changes to the remove functions.
I'm marking these as "changes requested".
--
Kind regards,
Sakari Ailus