* [PATCH] media: i2c: ov13b10: fix power leak on remove while runtime-active
@ 2026-09-28 14:02 Cong Nguyen
0 siblings, 0 replies; only message in thread
From: Cong Nguyen @ 2026-09-28 14:02 UTC (permalink / raw)
To: Sakari Ailus; +Cc: Arec Kao, Mauro Carvalho Chehab, linux-media, linux-kernel
ov13b10_remove() calls pm_runtime_set_suspended(), but that's pure
bookkeeping -- it doesn't call ov13b10_suspend() (which actually
deasserts reset, disables the regulators, and disables/unprepares the
clock via ov13b10_power_off()).
If unbound while ov13b10_set_stream() is holding an outstanding PM
reference (removed while actively streaming), the device stays
genuinely active with regulators/clock enabled forever after.
Call ov13b10_suspend() 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: 7ee850546822 ("media: Add sensor driver support for the ov13b10 camera.")
Assisted-by: LLM
Signed-off-by: Cong Nguyen <congnt264@gmail.com>
---
drivers/media/i2c/ov13b10.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/i2c/ov13b10.c b/drivers/media/i2c/ov13b10.c
index b0d34141a13a..ab5cf9af2e85 100644
--- a/drivers/media/i2c/ov13b10.c
+++ b/drivers/media/i2c/ov13b10.c
@@ -1688,6 +1688,8 @@ static void ov13b10_remove(struct i2c_client *client)
ov13b10_free_controls(ov13b);
pm_runtime_disable(ov13b->dev);
+ if (!pm_runtime_status_suspended(ov13b->dev))
+ ov13b10_suspend(ov13b->dev);
pm_runtime_set_suspended(ov13b->dev);
}
--
2.25.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-28 14:02 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:02 [PATCH] media: i2c: ov13b10: 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®