Skip to content

Commit 94bc403

Browse files
mripardpelwell
authored andcommitted
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") Signed-off-by: Maxime Ripard <[email protected]>
1 parent 827ba39 commit 94bc403

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
@@ -2253,6 +2253,18 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22532253
vc4_hdmi->disable_4kp60 = true;
22542254
}
22552255

2256+
/*
2257+
* We need to have the device powered up at this point to call
2258+
* our reset hook and for the CEC init.
2259+
*/
2260+
ret = vc4_hdmi_runtime_resume(dev);
2261+
if (ret)
2262+
goto err_put_ddc;
2263+
2264+
pm_runtime_get_noresume(dev);
2265+
pm_runtime_set_active(dev);
2266+
pm_runtime_enable(dev);
2267+
22562268
if (vc4_hdmi->variant->reset)
22572269
vc4_hdmi->variant->reset(vc4_hdmi);
22582270

@@ -2264,8 +2276,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22642276
clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
22652277
}
22662278

2267-
pm_runtime_enable(dev);
2268-
22692279
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
22702280
drm_encoder_helper_add(encoder, &vc4_hdmi_encoder_helper_funcs);
22712281

@@ -2289,6 +2299,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22892299
vc4_hdmi_debugfs_regs,
22902300
vc4_hdmi);
22912301

2302+
pm_runtime_put_sync(dev);
2303+
22922304
return 0;
22932305

22942306
err_free_cec:
@@ -2297,6 +2309,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
22972309
vc4_hdmi_connector_destroy(&vc4_hdmi->connector);
22982310
err_destroy_encoder:
22992311
drm_encoder_cleanup(encoder);
2312+
pm_runtime_put_sync(dev);
23002313
pm_runtime_disable(dev);
23012314
err_put_ddc:
23022315
put_device(&vc4_hdmi->ddc->dev);

0 commit comments

Comments
 (0)