Skip to content

Commit 597031c

Browse files
mripardpopcornmix
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 <maxime@cerno.tech>
1 parent e63c3d6 commit 597031c

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
@@ -2312,6 +2312,18 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
23122312
vc4_hdmi->disable_4kp60 = true;
23132313
}
23142314

2315+
/*
2316+
* We need to have the device powered up at this point to call
2317+
* our reset hook and for the CEC init.
2318+
*/
2319+
ret = vc4_hdmi_runtime_resume(dev);
2320+
if (ret)
2321+
goto err_put_ddc;
2322+
2323+
pm_runtime_get_noresume(dev);
2324+
pm_runtime_set_active(dev);
2325+
pm_runtime_enable(dev);
2326+
23152327
if (vc4_hdmi->variant->reset)
23162328
vc4_hdmi->variant->reset(vc4_hdmi);
23172329

@@ -2323,8 +2335,6 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
23232335
clk_prepare_enable(vc4_hdmi->pixel_bvb_clock);
23242336
}
23252337

2326-
pm_runtime_enable(dev);
2327-
23282338
drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS);
23292339
drm_encoder_helper_add(encoder, &vc4_hdmi_encoder_helper_funcs);
23302340

@@ -2348,6 +2358,8 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
23482358
vc4_hdmi_debugfs_regs,
23492359
vc4_hdmi);
23502360

2361+
pm_runtime_put_sync(dev);
2362+
23512363
return 0;
23522364

23532365
err_free_cec:
@@ -2358,6 +2370,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)
23582370
vc4_hdmi_connector_destroy(&vc4_hdmi->connector);
23592371
err_destroy_encoder:
23602372
drm_encoder_cleanup(encoder);
2373+
pm_runtime_put_sync(dev);
23612374
pm_runtime_disable(dev);
23622375
err_put_ddc:
23632376
put_device(&vc4_hdmi->ddc->dev);

0 commit comments

Comments
 (0)