Skip to content

Commit 085260e

Browse files
mripardpelwell
authored andcommitted
drm/vc4: hdmi: Put the device on error in pre_crtc_configure
In the vc4_hdmi_encoder_pre_crtc_configure() function error path we never actually call pm_runtime_put() even though pm_runtime_resume_and_get() is our very first call. Fixes: 4f6e3d6 ("drm/vc4: Add runtime PM support to the HDMI encoder driver") Signed-off-by: Maxime Ripard <[email protected]>
1 parent 94bc403 commit 085260e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/drm/vc4/vc4_hdmi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,26 +917,30 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
917917
ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);
918918
if (ret) {
919919
DRM_ERROR("Failed to retain power domain: %d\n", ret);
920+
pm_runtime_put(&vc4_hdmi->pdev->dev);
920921
return;
921922
}
922923

923924
pixel_rate = vc4_conn_state->pixel_rate;
924925
ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate);
925926
if (ret) {
926927
DRM_ERROR("Failed to set pixel clock rate: %d\n", ret);
928+
pm_runtime_put(&vc4_hdmi->pdev->dev);
927929
return;
928930
}
929931

930932
ret = clk_prepare_enable(vc4_hdmi->pixel_clock);
931933
if (ret) {
932934
DRM_ERROR("Failed to turn on pixel clock: %d\n", ret);
935+
pm_runtime_put(&vc4_hdmi->pdev->dev);
933936
return;
934937
}
935938

936939
hsm_rate = vc4_hdmi->variant->calc_hsm_clock(vc4_hdmi, pixel_rate);
937940
vc4_hdmi->hsm_req = clk_request_start(vc4_hdmi->hsm_clock, hsm_rate);
938941
if (IS_ERR(vc4_hdmi->hsm_req)) {
939942
DRM_ERROR("Failed to set HSM clock rate: %ld\n", PTR_ERR(vc4_hdmi->hsm_req));
943+
pm_runtime_put(&vc4_hdmi->pdev->dev);
940944
return;
941945
}
942946

@@ -955,6 +959,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
955959
DRM_ERROR("Failed to set pixel bvb clock rate: %ld\n", PTR_ERR(vc4_hdmi->bvb_req));
956960
clk_request_done(vc4_hdmi->hsm_req);
957961
clk_disable_unprepare(vc4_hdmi->pixel_clock);
962+
pm_runtime_put(&vc4_hdmi->pdev->dev);
958963
return;
959964
}
960965

@@ -965,6 +970,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
965970
clk_request_done(vc4_hdmi->bvb_req);
966971
clk_request_done(vc4_hdmi->hsm_req);
967972
clk_disable_unprepare(vc4_hdmi->pixel_clock);
973+
pm_runtime_put(&vc4_hdmi->pdev->dev);
968974
return;
969975
}
970976

0 commit comments

Comments
 (0)