mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-02-13 20:01:55 +00:00
70 lines
2.4 KiB
Diff
70 lines
2.4 KiB
Diff
From 3797df3a3dd478b3049920b0a78863835a319bbd Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Tue, 29 Jun 2021 11:36:38 +0200
|
|
Subject: [PATCH 500/552] 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: 4f6e3d66ac52 ("drm/vc4: Add runtime PM support to the HDMI encoder driver")
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
---
|
|
drivers/gpu/drm/vc4/vc4_hdmi.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
index ad51bac7688f..98a8ca85b559 100644
|
|
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
|
|
@@ -917,6 +917,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
|
|
ret = pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev);
|
|
if (ret < 0) {
|
|
DRM_ERROR("Failed to retain power domain: %d\n", ret);
|
|
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
|
|
return;
|
|
}
|
|
|
|
@@ -924,12 +925,14 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
|
|
ret = clk_set_rate(vc4_hdmi->pixel_clock, pixel_rate);
|
|
if (ret) {
|
|
DRM_ERROR("Failed to set pixel clock rate: %d\n", ret);
|
|
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
|
|
return;
|
|
}
|
|
|
|
ret = clk_prepare_enable(vc4_hdmi->pixel_clock);
|
|
if (ret) {
|
|
DRM_ERROR("Failed to turn on pixel clock: %d\n", ret);
|
|
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
|
|
return;
|
|
}
|
|
|
|
@@ -937,6 +940,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
|
|
vc4_hdmi->hsm_req = clk_request_start(vc4_hdmi->hsm_clock, hsm_rate);
|
|
if (IS_ERR(vc4_hdmi->hsm_req)) {
|
|
DRM_ERROR("Failed to set HSM clock rate: %ld\n", PTR_ERR(vc4_hdmi->hsm_req));
|
|
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
|
|
return;
|
|
}
|
|
|
|
@@ -956,6 +960,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
|
|
clk_request_done(vc4_hdmi->hsm_req);
|
|
clk_disable_unprepare(vc4_hdmi->hsm_clock);
|
|
clk_disable_unprepare(vc4_hdmi->pixel_clock);
|
|
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
|
|
return;
|
|
}
|
|
|
|
@@ -967,6 +972,7 @@ static void vc4_hdmi_encoder_pre_crtc_configure(struct drm_encoder *encoder,
|
|
clk_request_done(vc4_hdmi->hsm_req);
|
|
clk_disable_unprepare(vc4_hdmi->hsm_clock);
|
|
clk_disable_unprepare(vc4_hdmi->pixel_clock);
|
|
+ pm_runtime_put(&vc4_hdmi->pdev->dev);
|
|
return;
|
|
}
|
|
|
|
--
|
|
2.33.0
|
|
|