Skip to content

Commit 2d717d8

Browse files
mripardgregkh
authored andcommitted
drm/vc4: hdmi: Set a default HSM rate
[ Upstream commit 3e85b81 ] When the firmware doesn't setup the HSM rate (such as when booting without an HDMI cable plugged in), its rate is 0 and thus any register access results in a CPU stall, even though HSM is enabled. Let's enforce a minimum rate at boot to avoid this issue. Fixes: 4f6e3d6 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Signed-off-by: Maxime Ripard <[email protected]> Reviewed-by: Nicolas Saenz Julienne <[email protected]> Tested-by: Nicolas Saenz Julienne <[email protected]> Tested-by: Michael Stapelberg <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Sasha Levin <[email protected]>
1 parent 49b570f commit 2d717d8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
# define VC4_HD_M_SW_RST BIT(2)
9595
# define VC4_HD_M_ENABLE BIT(0)
9696

97+
#define HSM_MIN_CLOCK_FREQ 120000000
9798
#define CEC_CLOCK_FREQ 40000
9899

99100
#define HDMI_14_MAX_TMDS_CLK (340 * 1000 * 1000)
@@ -2161,6 +2162,19 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
21612162
vc4_hdmi->disable_4kp60 = true;
21622163
}
21632164

2165+
/*
2166+
* If we boot without any cable connected to the HDMI connector,
2167+
* the firmware will skip the HSM initialization and leave it
2168+
* with a rate of 0, resulting in a bus lockup when we're
2169+
* accessing the registers even if it's enabled.
2170+
*
2171+
* Let's put a sensible default at runtime_resume so that we
2172+
* don't end up in this situation.
2173+
*/
2174+
ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ);
2175+
if (ret)
2176+
goto err_put_ddc;
2177+
21642178
if (vc4_hdmi->variant->reset)
21652179
vc4_hdmi->variant->reset(vc4_hdmi);
21662180

0 commit comments

Comments
 (0)