HACK: dump clock tree on nvhost suspend hang

Change-Id: Iaf3075535fa6a100389a0b02508a0b7bc45e8ff9
Signed-off-by: Erik Gilling <konkers@android.com>
This commit is contained in:
Erik Gilling 2011-02-14 17:18:37 -08:00
parent e25518e592
commit 254b5e1c65
2 changed files with 35 additions and 1 deletions

View File

@ -832,6 +832,36 @@ static int clk_debugfs_register_one(struct clk *c)
return -ENOMEM;
}
static char tegra_clk_dump_buff[16 * 1024];
void tegra_clk_dump(void)
{
struct seq_file s;
int i;
char c;
memset(&s, 0x0, sizeof(s));
s.buf = tegra_clk_dump_buff;
s.size = sizeof(tegra_clk_dump_buff);
clock_tree_show(&s, NULL);
i = 0;
while (i < s.count ) {
if ((s.count - i) > 256) {
c = s.buf[i + 256];
s.buf[i + 256] = 0;
printk("%s", s.buf + i);
s.buf[i + 256] = c;
} else {
printk("%s", s.buf + i);
}
i += 256;
}
}
static int clk_debugfs_register(struct clk *c)
{
int err;

View File

@ -194,14 +194,18 @@ static int is_module_idle(struct nvhost_module *mod)
return (count == 0);
}
void tegra_clk_dump(void);
void nvhost_module_suspend(struct nvhost_module *mod)
{
int ret;
ret = wait_event_timeout(mod->idle, is_module_idle(mod),
ACM_TIMEOUT + msecs_to_jiffies(500));
if (ret == 0)
if (ret == 0) {
tegra_clk_dump();
nvhost_debug_dump();
}
flush_delayed_work(&mod->powerdown);
BUG_ON(mod->powered);
}