Skip to content

Commit 74f21be

Browse files
popcornmixgregkh
authored andcommitted
drm/vc4: hdmi: Avoid hang with debug registers when suspended
[ Upstream commit 223ee25 ] Trying to read /sys/kernel/debug/dri/1/hdmi1_regs when the hdmi is disconnected results in a fatal system hang. This is due to the pm suspend code disabling the dvp clock. That is just a gate of the 108MHz clock in DVP_HT_RPI_MISC_CONFIG, which results in accesses hanging AXI bus. Protect against this. Fixes: 25eb441 ("drm/vc4: hdmi: Add all the vc5 HDMI registers into the debugfs dumps") Signed-off-by: Dom Cobley <popcornmix@gmail.com> Reviewed-by: Maxime Ripard <mripard@kernel.org> Link: https://patchwork.freedesktop.org/patch/msgid/20240621152055.4180873-17-dave.stevenson@raspberrypi.com Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 8d4cd94 commit 74f21be

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
147147
if (!drm_dev_enter(drm, &idx))
148148
return -ENODEV;
149149

150+
WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
151+
150152
drm_print_regset32(&p, &vc4_hdmi->hdmi_regset);
151153
drm_print_regset32(&p, &vc4_hdmi->hd_regset);
152154
drm_print_regset32(&p, &vc4_hdmi->cec_regset);
@@ -156,6 +158,8 @@ static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
156158
drm_print_regset32(&p, &vc4_hdmi->ram_regset);
157159
drm_print_regset32(&p, &vc4_hdmi->rm_regset);
158160

161+
pm_runtime_put(&vc4_hdmi->pdev->dev);
162+
159163
drm_dev_exit(idx);
160164

161165
return 0;

0 commit comments

Comments
 (0)