mirror of
https://github.com/torvalds/linux.git
synced 2024-12-16 16:12:52 +00:00
ARM: OMAP: Add function to print clock usecounts
Useful for debugging power management code. Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
3151369d74
commit
0ce3356394
@ -33,6 +33,41 @@ static DEFINE_SPINLOCK(clockfw_lock);
|
|||||||
|
|
||||||
static struct clk_functions *arch_clock;
|
static struct clk_functions *arch_clock;
|
||||||
|
|
||||||
|
#ifdef CONFIG_PM_DEBUG
|
||||||
|
|
||||||
|
static void print_parents(struct clk *clk)
|
||||||
|
{
|
||||||
|
struct clk *p;
|
||||||
|
int printed = 0;
|
||||||
|
|
||||||
|
list_for_each_entry(p, &clocks, node) {
|
||||||
|
if (p->parent == clk && p->usecount) {
|
||||||
|
if (!clk->usecount && !printed) {
|
||||||
|
printk("MISMATCH: %s\n", clk->name);
|
||||||
|
printed = 1;
|
||||||
|
}
|
||||||
|
printk("\t%-15s\n", p->name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void clk_print_usecounts(void)
|
||||||
|
{
|
||||||
|
unsigned long flags;
|
||||||
|
struct clk *p;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&clockfw_lock, flags);
|
||||||
|
list_for_each_entry(p, &clocks, node) {
|
||||||
|
if (p->usecount)
|
||||||
|
printk("%-15s: %d\n", p->name, p->usecount);
|
||||||
|
print_parents(p);
|
||||||
|
|
||||||
|
}
|
||||||
|
spin_unlock_irqrestore(&clockfw_lock, flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------
|
/*-------------------------------------------------------------------------
|
||||||
* Standard clock functions defined in include/linux/clk.h
|
* Standard clock functions defined in include/linux/clk.h
|
||||||
*-------------------------------------------------------------------------*/
|
*-------------------------------------------------------------------------*/
|
||||||
|
Loading…
Reference in New Issue
Block a user