Skip to content

Commit ae71ab5

Browse files
committed
drm/vc4: hdmi: Enforce the minimum rate at runtime_resume
This is a revert of commit fd5894f ("drm/vc4: hdmi: Remove clock rate initialization"), with the code slightly moved around. It turns out that we can't downright remove that code from the driver, since the Pi0-3 and Pi4 are in different cases, and it only works for the Pi4. Indeed, the commit mentioned above was relying on the RaspberryPi firmware clocks driver to initialize the rate if it wasn't done by the firmware. However, the Pi0-3 are using the clk-bcm2835 clock driver that wasn't doing this initialization. We therefore end up with the clock not being assigned a rate, and the CPU stalling when trying to access a register. We can't move that initialization in the clk-bcm2835 driver, since the HSM clock we depend on is actually part of the HDMI power domain, so any rate setup is only valid when the power domain is enabled. Thus, we reinstated the minimum rate setup at runtime_suspend, which should address both issues. Link: https://lore.kernel.org/dri-devel/[email protected]/ Fixes: fd5894f ("drm/vc4: hdmi: Remove clock rate initialization") Reported-by: Marc Kleine-Budde <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Tested-by: Stefan Wahren <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d1c0b7d commit ae71ab5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,6 +2871,15 @@ static int vc4_hdmi_runtime_resume(struct device *dev)
28712871
u32 __maybe_unused value;
28722872
int ret;
28732873

2874+
/*
2875+
* The HSM clock is in the HDMI power domain, so we need to set
2876+
* its frequency while the power domain is active so that it
2877+
* keeps its rate.
2878+
*/
2879+
ret = clk_set_min_rate(vc4_hdmi->hsm_clock, HSM_MIN_CLOCK_FREQ);
2880+
if (ret)
2881+
return ret;
2882+
28742883
ret = clk_prepare_enable(vc4_hdmi->hsm_clock);
28752884
if (ret)
28762885
return ret;

0 commit comments

Comments
 (0)