* [PATCH] media: i2c: og01a1b: fix power leak on remove while runtime-active
@ 2026-09-28 14:14 Cong Nguyen
0 siblings, 0 replies; only message in thread
From: Cong Nguyen @ 2026-09-28 14:14 UTC (permalink / raw)
To: Sakari Ailus; +Cc: Mauro Carvalho Chehab, Shawn Tu, linux-media, linux-kernel
og01a1b_remove() calls pm_runtime_disable() and nothing else -- it
never calls og01a1b_power_off(), which actually powers the sensor
down (disables the input clock, asserts the reset gpio, disables the
dvdd/dovdd/avdd regulators). pm_runtime_disable() only blocks future
auto suspend/resume, it doesn't force a final one.
If unbound while the device is genuinely runtime-active (streaming,
or an open subdev fd holding a PM reference), the clock, gpio and
regulators stay in their active state with no code path left to ever
release them.
Call og01a1b_power_off() in that case, guarded by
pm_runtime_status_suspended() so the common already-suspended case
isn't suspended twice -- same guard sibling imx412.c's remove() uses.
Fixes: 472377febf84 ("media: Add a driver for the og01a1b camera sensor")
Assisted-by: LLM
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
drivers/media/i2c/og01a1b.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/i2c/og01a1b.c b/drivers/media/i2c/og01a1b.c
index 1675f0460969..632063cb7d30 100644
--- a/drivers/media/i2c/og01a1b.c
+++ b/drivers/media/i2c/og01a1b.c
@@ -956,6 +956,8 @@ static void og01a1b_remove(struct i2c_client *client)
media_entity_cleanup(&sd->entity);
v4l2_ctrl_handler_free(sd->ctrl_handler);
pm_runtime_disable(og01a1b->dev);
+ if (!pm_runtime_status_suspended(og01a1b->dev))
+ og01a1b_power_off(og01a1b->dev);
}
static int og01a1b_probe(struct i2c_client *client)
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-28 14:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-28 14:14 [PATCH] media: i2c: og01a1b: fix power leak on remove while runtime-active Cong Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®