From 254b5e1c65cd70f16f44f7f2e7ee2b2b76cebecc Mon Sep 17 00:00:00 2001 From: Erik Gilling Date: Mon, 14 Feb 2011 17:18:37 -0800 Subject: [PATCH] HACK: dump clock tree on nvhost suspend hang Change-Id: Iaf3075535fa6a100389a0b02508a0b7bc45e8ff9 Signed-off-by: Erik Gilling --- arch/arm/mach-tegra/clock.c | 30 +++++++++++++++++++++++++++ drivers/video/tegra/host/nvhost_acm.c | 6 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-tegra/clock.c b/arch/arm/mach-tegra/clock.c index e97cc2532aef..964c4c39ddd0 100644 --- a/arch/arm/mach-tegra/clock.c +++ b/arch/arm/mach-tegra/clock.c @@ -832,6 +832,36 @@ err_out: 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; diff --git a/drivers/video/tegra/host/nvhost_acm.c b/drivers/video/tegra/host/nvhost_acm.c index ef8f1ea2c13a..aac2757f7ca0 100644 --- a/drivers/video/tegra/host/nvhost_acm.c +++ b/drivers/video/tegra/host/nvhost_acm.c @@ -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); } -- 2.34.1