]> www.infradead.org Git - users/hch/misc.git/commit
drm/dp_mst: Fix locking when skipping CSN before topology probing
authorImre Deak <imre.deak@intel.com>
Fri, 7 Mar 2025 18:31:52 +0000 (20:31 +0200)
committerImre Deak <imre.deak@intel.com>
Tue, 11 Mar 2025 09:29:18 +0000 (11:29 +0200)
commit12d8f318347b1d4feac48e8ac351d3786af39599
tree4a1edb91f54c78c49a3d8dc2dc7855b4d8842776
parentde93ddf88088f7624b589d0ff3af9effb87e8f3b
drm/dp_mst: Fix locking when skipping CSN before topology probing

The handling of the MST Connection Status Notify message is skipped if
the probing of the topology is still pending. Acquiring the
drm_dp_mst_topology_mgr::probe_lock for this in
drm_dp_mst_handle_up_req() is problematic: the task/work this function
is called from is also responsible for handling MST down-request replies
(in drm_dp_mst_handle_down_rep()). Thus drm_dp_mst_link_probe_work() -
holding already probe_lock - could be blocked waiting for an MST
down-request reply while drm_dp_mst_handle_up_req() is waiting for
probe_lock while processing a CSN message. This leads to the probe
work's down-request message timing out.

A scenario similar to the above leading to a down-request timeout is
handling a CSN message in drm_dp_mst_handle_conn_stat(), holding the
probe_lock and sending down-request messages while a second CSN message
sent by the sink subsequently is handled by drm_dp_mst_handle_up_req().

Fix the above by moving the logic to skip the CSN handling to
drm_dp_mst_process_up_req(). This function is called from a work
(separate from the task/work handling new up/down messages), already
holding probe_lock. This solves the above timeout issue, since handling
of down-request replies won't be blocked by probe_lock.

Fixes: ddf983488c3e ("drm/dp_mst: Skip CSN if topology probing is not done yet")
Cc: Wayne Lin <Wayne.Lin@amd.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: stable@vger.kernel.org # v6.6+
Reviewed-by: Wayne Lin <Wayne.Lin@amd.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250307183152.3822170-1-imre.deak@intel.com
drivers/gpu/drm/display/drm_dp_mst_topology.c