Skip to contentSkip to conversation

host1x: hdmi: Make sure clock is enabled before dumping registers

PATCH Applied Mikko Perttunen 2 participants 2 messages Jul 30, 2013 – Aug 27, 2013

Subsystems (3)
lore
Share & tools
lore

Mikko Perttunen

author maintainer
#0 lore raw

PATCH 1/1 host1x: hdmi: Make sure clock is enabled before dumping registers

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.

---
 drivers/gpu/host1x/drm/hdmi.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/gpu/host1x/drm/hdmi.c +7 -0
index 01097da..bf7f027 100644
@@ -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;
 }
 
Signature · 1 line
1.8.1.5
#1 lore raw
Quoted 9 lines · Mikko Perttunen

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.

---
 drivers/gpu/host1x/drm/hdmi.c | 7 +++++++
 1 file changed, 7 insertions(+)

Applied, thanks.

Thierry