dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted
@ 2024-02-26 22:34 Dmitry Baryshkov
  2024-02-26 22:43 ` Abhinav Kumar
  2024-02-28 22:32 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2024-02-26 22:34 UTC (permalink / raw)
  To: Rob Clark, Sean Paul, Abhinav Kumar, Kuogee Hsieh, Sankeerth Billakanti
  Cc: Bjorn Andersson, Konrad Dybcio, Stephen Boyd, David Airlie,
	Daniel Vetter, linux-arm-msm, dri-devel, freedreno

The function dp_wait_hpd_asserted() uses pm_runtime_get_sync() and
doesn't care about the return value. Potentially this can lead to
unclocked access if for some reason resuming of the DP controller fails.

Change the function to use pm_runtime_resume_and_get() and return an
error if resume fails.

Fixes: e2969ee30252 ("drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe()")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 drivers/gpu/drm/msm/dp/dp_aux.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dp/dp_aux.c b/drivers/gpu/drm/msm/dp/dp_aux.c
index 03f4951c49f4..1a264e7deb90 100644
--- a/drivers/gpu/drm/msm/dp/dp_aux.c
+++ b/drivers/gpu/drm/msm/dp/dp_aux.c
@@ -509,7 +509,10 @@ static int dp_wait_hpd_asserted(struct drm_dp_aux *dp_aux,
 
 	aux = container_of(dp_aux, struct dp_aux_private, dp_aux);
 
-	pm_runtime_get_sync(aux->dev);
+	ret = pm_runtime_resume_and_get(aux->dev);
+	if (ret)
+		return ret;
+
 	ret = dp_catalog_aux_wait_for_hpd_connect_state(aux->catalog);
 	pm_runtime_put_sync(aux->dev);
 
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted
  2024-02-26 22:34 [PATCH] drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted Dmitry Baryshkov
@ 2024-02-26 22:43 ` Abhinav Kumar
  2024-02-28 22:32 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Abhinav Kumar @ 2024-02-26 22:43 UTC (permalink / raw)
  To: Dmitry Baryshkov, Rob Clark, Sean Paul, Kuogee Hsieh,
	Sankeerth Billakanti
  Cc: Bjorn Andersson, Konrad Dybcio, Stephen Boyd, David Airlie,
	Daniel Vetter, linux-arm-msm, dri-devel, freedreno



On 2/26/2024 2:34 PM, Dmitry Baryshkov wrote:
> The function dp_wait_hpd_asserted() uses pm_runtime_get_sync() and
> doesn't care about the return value. Potentially this can lead to
> unclocked access if for some reason resuming of the DP controller fails.
> 
> Change the function to use pm_runtime_resume_and_get() and return an
> error if resume fails.
> 
> Fixes: e2969ee30252 ("drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe()")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
>   drivers/gpu/drm/msm/dp/dp_aux.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted
  2024-02-26 22:34 [PATCH] drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted Dmitry Baryshkov
  2024-02-26 22:43 ` Abhinav Kumar
@ 2024-02-28 22:32 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2024-02-28 22:32 UTC (permalink / raw)
  To: Abhinav Kumar, Dmitry Baryshkov, Kuogee Hsieh, Rob Clark,
	Sankeerth Billakanti, Sean Paul
  Cc: Bjorn Andersson, Konrad Dybcio, David Airlie, Daniel Vetter,
	linux-arm-msm, dri-devel, freedreno

Quoting Dmitry Baryshkov (2024-02-26 14:34:45)
> The function dp_wait_hpd_asserted() uses pm_runtime_get_sync() and
> doesn't care about the return value. Potentially this can lead to
> unclocked access if for some reason resuming of the DP controller fails.
>
> Change the function to use pm_runtime_resume_and_get() and return an
> error if resume fails.
>
> Fixes: e2969ee30252 ("drm/msm/dp: move of_dp_aux_populate_bus() to eDP probe()")
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-28 22:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-26 22:34 [PATCH] drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted Dmitry Baryshkov
2024-02-26 22:43 ` Abhinav Kumar
2024-02-28 22:32 ` Stephen Boyd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).