The ST_MAINLINK_READY state and msm_dp::link_ready both indicate when link training has been successfully completed and the link is ready to be used.
Thus, replace ST_MAINLINK_READY checks with a check for msm_dp::link_ready. Signed-off-by: Jessica Zhang <jessica.zh...@oss.qualcomm.com> --- drivers/gpu/drm/msm/dp/dp_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c index f93fbcff2cda..af3cc32aa123 100644 --- a/drivers/gpu/drm/msm/dp/dp_display.c +++ b/drivers/gpu/drm/msm/dp/dp_display.c @@ -595,7 +595,7 @@ static int msm_dp_hpd_plug_handle(struct msm_dp_display_private *dp, u32 data) drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n", dp->msm_dp_display.connector_type, state); - if (state == ST_MAINLINK_READY || state == ST_CONNECTED) { + if (dp->msm_dp_display.link_ready) { mutex_unlock(&dp->event_mutex); return 0; } @@ -677,7 +677,7 @@ static int msm_dp_hpd_unplug_handle(struct msm_dp_display_private *dp, u32 data) } else if (state == ST_DISCONNECT_PENDING) { mutex_unlock(&dp->event_mutex); return 0; - } else if (state == ST_MAINLINK_READY) { + } else if (state != ST_CONNECTED && dp->msm_dp_display.link_ready) { msm_dp_ctrl_off_link(dp->ctrl); msm_dp_display_host_phy_exit(dp); dp->hpd_state = ST_DISCONNECTED; @@ -723,8 +723,8 @@ static int msm_dp_irq_hpd_handle(struct msm_dp_display_private *dp, u32 data) drm_dbg_dp(dp->drm_dev, "Before, type=%d hpd_state=%d\n", dp->msm_dp_display.connector_type, state); - if (state == ST_MAINLINK_READY || state == ST_DISCONNECT_PENDING) { - /* wait until ST_CONNECTED */ + if (dp->msm_dp_display.link_ready != dp->msm_dp_display.connected) { + /* wait until connect/disconnect handling is completed */ msm_dp_add_event(dp, EV_IRQ_HPD_INT, 0, 1); /* delay = 1 */ mutex_unlock(&dp->event_mutex); return 0; -- 2.50.1