HACK: dump clock tree on nvhost suspend hang
authorErik Gilling <konkers@android.com>
Tue, 15 Feb 2011 01:18:37 +0000 (17:18 -0800)
committerErik Gilling <konkers@android.com>
Tue, 15 Feb 2011 01:20:39 +0000 (17:20 -0800)
Change-Id: Iaf3075535fa6a100389a0b02508a0b7bc45e8ff9
Signed-off-by: Erik Gilling <konkers@android.com>
arch/arm/mach-tegra/clock.c
drivers/video/tegra/host/nvhost_acm.c

index e97cc2532aef3d35cc849810a5c6bfba03a2b912..964c4c39ddd09b39514c1de997db7d4f0eda0acd 100644 (file)
@@ -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;
index ef8f1ea2c13a9472a5b4010fddafbc0dd98c5402..aac2757f7ca019f1d68de7b92a5bab9ef5810cf5 100644 (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);
 }