drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted
PATCH 1/1 drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted
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.
--- drivers/gpu/drm/msm/dp/dp_aux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_aux.c +4 -1
@@ -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);
Signature · 1 line
2.39.2
Quoted 4 lines · Dmitry Baryshkov
The function
dp_wait_hpd_asserted()usespm_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.
Quoted 9 lines
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 <[email protected]>--- drivers/gpu/drm/msm/dp/dp_aux.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Quoting Dmitry Baryshkov (2024-02-26 14:34:45)
Quoted 10 lines
The function
dp_wait_hpd_asserted()usespm_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 <[email protected]>---
Abhinav Kumar
AppliedQuoted 8 lines · Dmitry Baryshkov
The function
dp_wait_hpd_asserted()usespm_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.[...]
Applied, thanks!
[1/1] drm/msm/dp: fix runtime_pm handling in dp_wait_hpd_asserted
https://gitlab.freedesktop.org/abhinavk/msm-next/-/commit/3e40e281afa0
Best regards,
Signature · 1 line
Abhinav Kumar <[email protected]>