Thread (35 messages) 35 messages, 5 authors, 2023-10-04
STALE1016d

[PATCH 04/13] clk: print debug message if parent change is ignored

From: Benjamin Bara <hidden>
Date: 2023-09-17 22:41:27
Also in: linux-clk, linux-devicetree, lkml
Subsystem: common clk framework, the rest · Maintainers: Michael Turquette, Stephen Boyd, Linus Torvalds

From: Benjamin Bara <redacted>

Print a debug message if the determination of the best clock rate
suggests a re-config of the parent (which means the actual driver
considers doing so), but the clock is not configured with
CLK_SET_PARENT_RATE.

This should give a good hint for clock config improvement potential.

Signed-off-by: Benjamin Bara <redacted>
---
 drivers/clk/clk.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 3e222802b712..4954d31899ce 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2241,9 +2241,14 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core,
 		}
 	}
 
-	if ((core->flags & CLK_SET_RATE_PARENT) && parent &&
-	    best_parent_rate != parent->rate)
-		top = clk_calc_new_rates(parent, best_parent_rate);
+	if (parent && best_parent_rate != parent->rate) {
+		if (core->flags & CLK_SET_RATE_PARENT)
+			top = clk_calc_new_rates(parent, best_parent_rate);
+		else
+			pr_debug("%s: ignore parent %s re-config from %lu to %lu\n",
+				 core->name, parent->name, parent->rate,
+				 best_parent_rate);
+	}
 
 out:
 	clk_calc_subtree(core, new_rate, parent, p_index);
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help