2024-03-13 17:39:54

by Johan Hovold

[permalink] [raw]
Subject: [PATCH 2/2] drm/msm/dp: fix runtime PM leak on connect failure

Make sure to balance the runtime PM usage counter (and suspend) before
returning on connect failures (e.g. DPCD read failures after a spurious
connect event or if link training fails).

Fixes: 5814b8bf086a ("drm/msm/dp: incorporate pm_runtime framework into DP driver")
Cc: [email protected] # 6.8
Cc: Kuogee Hsieh <[email protected]>
Signed-off-by: Johan Hovold <[email protected]>
---
drivers/gpu/drm/msm/dp/dp_display.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
index 8e8cf531da45..78464c395c3d 100644
--- a/drivers/gpu/drm/msm/dp/dp_display.c
+++ b/drivers/gpu/drm/msm/dp/dp_display.c
@@ -598,6 +598,7 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)
ret = dp_display_usbpd_configure_cb(&pdev->dev);
if (ret) { /* link train failed */
dp->hpd_state = ST_DISCONNECTED;
+ pm_runtime_put_sync(&pdev->dev);
} else {
dp->hpd_state = ST_MAINLINK_READY;
}
--
2.43.2



2024-03-13 19:06:57

by Abhinav Kumar

[permalink] [raw]
Subject: Re: [PATCH 2/2] drm/msm/dp: fix runtime PM leak on connect failure



On 3/13/2024 9:43 AM, Johan Hovold wrote:
> Make sure to balance the runtime PM usage counter (and suspend) before
> returning on connect failures (e.g. DPCD read failures after a spurious
> connect event or if link training fails).
>
> Fixes: 5814b8bf086a ("drm/msm/dp: incorporate pm_runtime framework into DP driver")
> Cc: [email protected] # 6.8
> Cc: Kuogee Hsieh <[email protected]>
> Signed-off-by: Johan Hovold <[email protected]>

Reviewed-by: Abhinav Kumar <[email protected]>