[RFC PATCH 4/4] clk: Skip disabling clocks if they have consumers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If a clock has already consumers, it should be considered as used.
So clk_disable_unused should leave it as is.

Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxx>
---
 drivers/clk/clk.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index e412e83a6e28..6cce31ea4f72 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1228,6 +1228,9 @@ static void __init clk_unprepare_unused_subtree(struct clk_core *core)
 	hlist_for_each_entry(child, &core->children, child_node)
 		clk_unprepare_unused_subtree(child);
 
+	if (core->consumers_count)
+		return;
+
 	if (core->prepare_count)
 		return;
 
@@ -1259,6 +1262,9 @@ static void __init clk_disable_unused_subtree(struct clk_core *core)
 	hlist_for_each_entry(child, &core->children, child_node)
 		clk_disable_unused_subtree(child);
 
+	if (core->consumers_count)
+		return;
+
 	if (core->flags & CLK_OPS_PARENT_ENABLE)
 		clk_core_prepare_enable(core->parent);
 
-- 
2.34.3




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux