From 7b798deb9bafae3770cc88f7cb3ca992339d6f5e Mon Sep 17 00:00:00 2001 From: Sudarsan Ramesh Date: Wed, 12 Aug 2020 19:19:12 -0400 Subject: [PATCH] disp: msm: dp: fix mst port state reporting on hpd unplug The simulation case uses dp_mst_sim_detect_port which calls the drm detect port function after checking the mst state. The non simulation case calls the drm function directly. This leads to cases in the disconnect path where connectors are detected while being unregistered. This solution merges the simulation and non simulation cases by using the same detect port function, where a check for mst state is performed before calling the drm function. Change-Id: I4a93001131beda54f8146bd50edc036924c94ab1 Signed-off-by: Sudarsan Ramesh --- msm/dp/dp_mst_drm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/msm/dp/dp_mst_drm.c b/msm/dp/dp_mst_drm.c index 77ece8fbcf24..e7b9712bc308 100644 --- a/msm/dp/dp_mst_drm.c +++ b/msm/dp/dp_mst_drm.c @@ -625,7 +625,7 @@ static void dp_mst_sim_handle_hpd_irq(void *dp_display, } } -static enum drm_connector_status dp_mst_sim_detect_port( +static enum drm_connector_status dp_mst_detect_port( struct drm_connector *connector, struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port) @@ -637,7 +637,7 @@ static enum drm_connector_status dp_mst_sim_detect_port( if (mst->mst_session_state) status = drm_dp_mst_detect_port(connector, mgr, port); - DP_MST_DEBUG("mst sim port status: %d, session state: %d\n", + DP_MST_DEBUG("mst port status: %d, session state: %d\n", status, mst->mst_session_state); return status; } @@ -701,7 +701,7 @@ static const struct dp_drm_mst_fw_helper_ops drm_dp_mst_fw_helper_ops = { .update_payload_part1 = drm_dp_update_payload_part1, .check_act_status = drm_dp_check_act_status, .update_payload_part2 = drm_dp_update_payload_part2, - .detect_port = drm_dp_mst_detect_port, + .detect_port = dp_mst_detect_port, .get_edid = drm_dp_mst_get_edid, .topology_mgr_set_mst = drm_dp_mst_topology_mgr_set_mst, .get_vcpi_info = _dp_mst_get_vcpi_info, @@ -718,7 +718,7 @@ static const struct dp_drm_mst_fw_helper_ops drm_dp_sim_mst_fw_helper_ops = { .update_payload_part1 = dp_mst_sim_update_payload_part1, .check_act_status = dp_mst_sim_no_action, .update_payload_part2 = dp_mst_sim_update_payload_part2, - .detect_port = dp_mst_sim_detect_port, + .detect_port = dp_mst_detect_port, .get_edid = dp_mst_sim_get_edid, .topology_mgr_set_mst = dp_mst_sim_topology_mgr_set_mst, .get_vcpi_info = _dp_mst_get_vcpi_info,