Skip to contentSkip to conversation

ARM: OMAP: PM: Lock clocks list while generating summary

PATCH New Nishanth Menon 2 participants 2 messages May 18, 2012 – May 24, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: OMAP: PM: Lock clocks list while generating summary

From: Todd Poynor <[email protected]>

commit a53025724052b2b1edbc982a4a248784638f563d (OMAP: Add debugfs node to show the summary of all clocks)

Introduced clock summary, however, we are interested in seeing snapshot of the clock state, not in dynamically changing clock configurations as the data provided by clock summary will then be useless for debugging configuration issues. So, hold the common lock when dumping the clock summary.

Cc Paul Walmsley <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc linux-omap at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
[nm at ti.com: added commit message]
---
 arch/arm/plat-omap/clock.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/plat-omap/clock.c +2 -0
index 62ec5c4..706b7e2 100644
@@ -461,6 +461,7 @@ static int clk_dbg_show_summary(struct seq_file *s, void *unused)
 	struct clk *c;
 	struct clk *pa;
 
+	mutex_lock(&clocks_mutex);
 	seq_printf(s, "%-30s %-30s %-10s %s\n",
 		"clock-name", "parent-name", "rate", "use-count");
 
@@ -469,6 +470,7 @@ static int clk_dbg_show_summary(struct seq_file *s, void *unused)
 		seq_printf(s, "%-30s %-30s %-10lu %d\n",
 			c->name, pa ? pa->name : "none", c->rate, c->usecount);
 	}
+	mutex_unlock(&clocks_mutex);
 
 	return 0;
 }
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw

PATCH 1/1 ARM: OMAP: PM: Lock clocks list while generating summary

Quoted 11 lines · Nishanth Menon

From: Todd Poynor <[email protected]>

commit a53025724052b2b1edbc982a4a248784638f563d (OMAP: Add debugfs node to show the summary of all clocks)

Introduced clock summary, however, we are interested in seeing snapshot of the clock state, not in dynamically changing clock configurations as the data provided by clock summary will then be useless for debugging configuration issues. So, hold the common lock when dumping the clock summary.

Quoted 8 lines
Cc Paul Walmsley <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc linux-omap at vger.kernel.org
Cc linux-arm-kernel at lists.infradead.org
[nm at ti.com: added commit message]

Thanks, queued for 3.5-rc.

- Paul