9f58504abb1de1a66ed52632467b8d62f7aca3d5
[openwrt/staging/blocktrron.git] /
1 From db41506f785ad84895a31b01e8bd7c07bceabb3d Mon Sep 17 00:00:00 2001
2 From: Dom Cobley <popcornmix@gmail.com>
3 Date: Tue, 5 Sep 2023 19:38:24 +0100
4 Subject: [PATCH 0597/1085] drm/vc4: hdmi: Avoid hang with debug registers when
5 suspended
6
7 Trying to read /sys/kernel/debug/dri/1/hdmi1_regs
8 when the hdmi is disconnected results in a fatal system hang.
9
10 This is due to the pm suspend code disabling the dvp clock.
11 That is just a gate of the 108MHz clock in DVP_HT_RPI_MISC_CONFIG,
12 which results in accesses hanging AXI bus.
13
14 Protect against this.
15
16 Signed-off-by: Dom Cobley <popcornmix@gmail.com>
17 ---
18 drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++
19 1 file changed, 4 insertions(+)
20
21 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
22 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
23 @@ -185,6 +185,8 @@ static int vc4_hdmi_debugfs_regs(struct
24 if (!drm_dev_enter(drm, &idx))
25 return -ENODEV;
26
27 + WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev));
28 +
29 drm_print_regset32(&p, &vc4_hdmi->hdmi_regset);
30 drm_print_regset32(&p, &vc4_hdmi->hd_regset);
31 drm_print_regset32(&p, &vc4_hdmi->cec_regset);
32 @@ -194,6 +196,8 @@ static int vc4_hdmi_debugfs_regs(struct
33 drm_print_regset32(&p, &vc4_hdmi->ram_regset);
34 drm_print_regset32(&p, &vc4_hdmi->rm_regset);
35
36 + pm_runtime_put(&vc4_hdmi->pdev->dev);
37 +
38 drm_dev_exit(idx);
39
40 return 0;