Skip to content

Commit ddf9834

Browse files
Wayne LinLyude
authored andcommitted
drm/dp_mst: Skip CSN if topology probing is not done yet
[Why] During resume, observe that we receive CSN event before we start topology probing. Handling CSN at this moment based on uncertain topology is unnecessary. [How] Add checking condition in drm_dp_mst_handle_up_req() to skip handling CSN if the topology is yet to be probed. Cc: Lyude Paul <[email protected]> Cc: Harry Wentland <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Imre Deak <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: [email protected] Signed-off-by: Wayne Lin <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Signed-off-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent d63d810 commit ddf9834

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/gpu/drm/display/drm_dp_mst_topology.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4069,6 +4069,7 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
40694069
if (up_req->msg.req_type == DP_CONNECTION_STATUS_NOTIFY) {
40704070
const struct drm_dp_connection_status_notify *conn_stat =
40714071
&up_req->msg.u.conn_stat;
4072+
bool handle_csn;
40724073

40734074
drm_dbg_kms(mgr->dev, "Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n",
40744075
conn_stat->port_number,
@@ -4077,6 +4078,16 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
40774078
conn_stat->message_capability_status,
40784079
conn_stat->input_port,
40794080
conn_stat->peer_device_type);
4081+
4082+
mutex_lock(&mgr->probe_lock);
4083+
handle_csn = mgr->mst_primary->link_address_sent;
4084+
mutex_unlock(&mgr->probe_lock);
4085+
4086+
if (!handle_csn) {
4087+
drm_dbg_kms(mgr->dev, "Got CSN before finish topology probing. Skip it.");
4088+
kfree(up_req);
4089+
goto out;
4090+
}
40804091
} else if (up_req->msg.req_type == DP_RESOURCE_STATUS_NOTIFY) {
40814092
const struct drm_dp_resource_status_notify *res_stat =
40824093
&up_req->msg.u.resource_stat;

0 commit comments

Comments
 (0)