drm/tegra: hdmi: Make sure clock is enabled before dumping registers
authorMikko Perttunen <mperttunen@nvidia.com>
Tue, 30 Jul 2013 08:35:03 +0000 (11:35 +0300)
committerThierry Reding <treding@nvidia.com>
Tue, 27 Aug 2013 08:19:39 +0000 (10:19 +0200)
The debugfs register dumping function did not enable the HDMI clock.
This led to a possible system hang when reading the debugfs entry
while no HDMI cable was connected to the system. This patch makes
sure that the clock is enabled during the read.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/host1x/drm/hdmi.c

index 01097da09f7f4033f565307e593d16b0523870e8..bf7f02743419bf18531026a5f745128ce874c6ad 100644 (file)
@@ -904,6 +904,11 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data)
 {
        struct drm_info_node *node = s->private;
        struct tegra_hdmi *hdmi = node->info_ent->data;
+       int err;
+
+       err = clk_enable(hdmi->clk);
+       if (err)
+               return err;
 
 #define DUMP_REG(name)                                         \
        seq_printf(s, "%-56s %#05x %08lx\n", #name, name,       \
@@ -1069,6 +1074,8 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data)
 
 #undef DUMP_REG
 
+       clk_disable(hdmi->clk);
+
        return 0;
 }