Skip to contentSkip to conversation

clk: add debug message showing which unused clocks are disabled on boot

PATCH In review Brian Masney 2 participants 4 messages Nov 17, 2022 – Apr 11, 2023 Common clk

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clk: add debug message showing which unused clocks are disabled on boot

The clk framework on bootup will automatically disable all unused clocks on bootup unless the clk_ignore_unused kernel parameter is present. Let's add a basic debugging log statement here that shows which clocks are disabled. There is already tracepoint present here as well, but there's nothing like a simple, good ol' fashioned printk for simplicity.

---
 drivers/clk/clk.c | 1 +
 1 file changed, 1 insertion(+)
drivers/clk/clk.c +1 -0
index 57b83665e5c3..ddf5a48e72b6 100644
@@ -1352,6 +1352,7 @@ static void __init clk_disable_unused_subtree(struct clk_core *core)
 	 * back to .disable
 	 */
 	if (clk_core_is_enabled(core)) {
+		dev_dbg(core->dev, "Powering off unused clock %s\n", core->name);
 		trace_clk_disable(core);
 		if (core->ops->disable_unused)
 			core->ops->disable_unused(core->hw);
Signature · 1 line
2.38.1
maintainer
#1 lore raw

Quoting Brian Masney (2022-11-17 02:58:29)

Quoted 8 lines

The clk framework on bootup will automatically disable all unused clocks on bootup unless the clk_ignore_unused kernel parameter is present. Let's add a basic debugging log statement here that shows which clocks are disabled. There is already tracepoint present here as well, but there's nothing like a simple, good ol' fashioned printk for simplicity.

---

I'd like to see a documentation update instead that covers how to enable the tracepoint on the kernel commandline and have it print to the serial console.

#2 lore raw
Quoted 7 lines · Stephen Boyd

Quoting Brian Masney (2022-11-17 02:58:29)

Quoted 6 lines

The clk framework on bootup will automatically disable all unused clocks on bootup unless the clk_ignore_unused kernel parameter is present. Let's add a basic debugging log statement here that shows which clocks are disabled. There is already tracepoint present here as well, but there's nothing like a simple, good ol' fashioned printk for simplicity.

Quoted 6 lines
Quoted 2 lines

---

I'd like to see a documentation update instead that covers how to enable the tracepoint on the kernel commandline and have it print to the serial console.

Sure, I can do that. I see there's a section 'Disabling clock gating of unused clocks' in Documentation/driver-api/clk.rst where I think this would be appropriate.

Brian

#3 lore raw
Quoted 11 lines · Brian Masney
Quoted 10 lines · Stephen Boyd

Quoting Brian Masney (2022-11-17 02:58:29)

Quoted 8 lines

The clk framework on bootup will automatically disable all unused clocks on bootup unless the clk_ignore_unused kernel parameter is present. Let's add a basic debugging log statement here that shows which clocks are disabled. There is already tracepoint present here as well, but there's nothing like a simple, good ol' fashioned printk for simplicity.

---

Quoted 7 lines
Quoted 3 lines

I'd like to see a documentation update instead that covers how to enable the tracepoint on the kernel commandline and have it print to the serial console.

Sure, I can do that. I see there's a section 'Disabling clock gating of unused clocks' in Documentation/driver-api/clk.rst where I think this would be appropriate.

Just to close out this thread, I submitted a patch to the docs tree.

https://lore.kernel.org/lkml/[email protected]/T/#u

Brian