All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: mali-c55: fix clock leak when reset deassert fails
@ 2026-07-24  2:53 Chen Changcheng
  2026-07-27 10:48 ` Jacopo Mondi
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Changcheng @ 2026-07-24  2:53 UTC (permalink / raw)
  To: dan.scally, jacopo.mondi, mchehab, p.zabel
  Cc: linux-media, linux-kernel, Chen Changcheng

In __mali_c55_power_on(), if clk_bulk_prepare_enable() succeeds but
reset_control_bulk_deassert() fails, the function returns the error
directly without disabling the clocks. This leaves the clocks enabled
permanently in the runtime resume path, or leaks them in the probe
path.

Fix this by calling clk_bulk_disable_unprepare() before returning the
error.

Signed-off-by: Chen Changcheng <chenchangcheng@kylinos.cn>
---
 drivers/media/platform/arm/mali-c55/mali-c55-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/arm/mali-c55/mali-c55-core.c b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
index 94a389b3f833..f28e9f4354ac 100644
--- a/drivers/media/platform/arm/mali-c55/mali-c55-core.c
+++ b/drivers/media/platform/arm/mali-c55/mali-c55-core.c
@@ -698,6 +698,8 @@ static int __mali_c55_power_on(struct mali_c55 *mali_c55)
 					  mali_c55->resets);
 	if (ret) {
 		dev_err(mali_c55->dev, "failed to deassert resets\n");
+		clk_bulk_disable_unprepare(ARRAY_SIZE(mali_c55->clks),
+					   mali_c55->clks);
 		return ret;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-27 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24  2:53 [PATCH] media: mali-c55: fix clock leak when reset deassert fails Chen Changcheng
2026-07-27 10:48 ` Jacopo Mondi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.