Skip to content

Commit 9c6e4f6

Browse files
committed
drm/vc4: hdmi: Make sure the controller is powered up during bind
In the bind hook, we actually need the device to have the HSM clock running during the final part of the display initialisation where we reset the controller and initialise the CEC component. Failing to do so will result in a complete, silent, hang of the CPU. Fixes: 411efa1 ("drm/vc4: hdmi: Move the HSM clock enable to runtime_pm") Link: https://patchwork.freedesktop.org/patch/msgid/20210819135931.895976-3-maxime@cerno.tech Reviewed-by: Dave Stevenson <dave.stevenson@raspberrypi.com> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
1 parent 0f52513 commit 9c6e4f6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,6 +2199,18 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
21992199
if (ret)
22002200
goto err_put_ddc;
22012201

2202+
/*
2203+
* We need to have the device powered up at this point to call
2204+
* our reset hook and for the CEC init.
2205+
*/
2206+
ret = vc4_hdmi_runtime_resume(dev);
2207+
if (ret)
2208+
goto err_put_ddc;
2209+
2210+
pm_runtime_get_noresume(dev);
2211+
pm_runtime_set_active(dev);
2212+
pm_runtime_enable(dev);
2213+
22022214
if (vc4_hdmi->variant->reset)
22032215
vc4_hdmi->variant->reset(vc4_hdmi);
22042216

@@ -2210,8 +2222,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22102222
clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
22112223
}
22122224

2213-
pm_runtime_enable(dev);
2214-
22152225
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
22162226
drm_encoder_helper_add(encoder, &vc4_hdmi_encoder_helper_funcs);
22172227

@@ -2235,6 +2245,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22352245
vc4_hdmi_debugfs_regs,
22362246
vc4_hdmi);
22372247

2248+
pm_runtime_put_sync(dev);
2249+
22382250
return 0;
22392251

22402252
err_free_cec:
@@ -2245,6 +2257,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22452257
vc4_hdmi_connector_destroy(&vc4_hdmi->connector);
22462258
err_destroy_encoder:
22472259
drm_encoder_cleanup(encoder);
2260+
pm_runtime_put_sync(dev);
22482261
pm_runtime_disable(dev);
22492262
err_put_ddc:
22502263
put_device(&vc4_hdmi->ddc->dev);

0 commit comments

Comments
 (0)