]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/dp_mst: Skip CSN if topology probing is not done yet
authorWayne Lin <Wayne.Lin@amd.com>
Wed, 26 Jun 2024 08:48:24 +0000 (16:48 +0800)
committerLyude Paul <lyude@redhat.com>
Wed, 3 Jul 2024 13:55:54 +0000 (09:55 -0400)
[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 <lyude@redhat.com>
Cc: Harry Wentland <hwentlan@amd.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: stable@vger.kernel.org
Signed-off-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240626084825.878565-3-Wayne.Lin@amd.com
drivers/gpu/drm/display/drm_dp_mst_topology.c

index 68831f4e502a28289dd5190fa1143cf3d68fe0a3..fc2ceae61db2d0f6c31f6e6e1da35b2fce6a79db 100644 (file)
@@ -4069,6 +4069,7 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
        if (up_req->msg.req_type == DP_CONNECTION_STATUS_NOTIFY) {
                const struct drm_dp_connection_status_notify *conn_stat =
                        &up_req->msg.u.conn_stat;
+               bool handle_csn;
 
                drm_dbg_kms(mgr->dev, "Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n",
                            conn_stat->port_number,
@@ -4077,6 +4078,16 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr)
                            conn_stat->message_capability_status,
                            conn_stat->input_port,
                            conn_stat->peer_device_type);
+
+               mutex_lock(&mgr->probe_lock);
+               handle_csn = mgr->mst_primary->link_address_sent;
+               mutex_unlock(&mgr->probe_lock);
+
+               if (!handle_csn) {
+                       drm_dbg_kms(mgr->dev, "Got CSN before finish topology probing. Skip it.");
+                       kfree(up_req);
+                       goto out;
+               }
        } else if (up_req->msg.req_type == DP_RESOURCE_STATUS_NOTIFY) {
                const struct drm_dp_resource_status_notify *res_stat =
                        &up_req->msg.u.resource_stat;