On Mon, Jun 22, 2026 at 05:03:58PM +0300, Luca Coelho wrote:
> A hotplug or link-loss event can tear down the MST topology
> (setting mgr->mst_state = false and mgr->mst_primary = NULL) concurrently
> with a caller invoking drm_dp_mst_topology_queue_probe(). Since the check
> is already performed under mgr->lock, the condition is not a programming
> error but a valid race -- the topology was valid when the caller decided
> to call this function, but was torn down before the lock was acquired.
>
> Replace the drm_WARN_ON() with a graceful early return. This eliminates
> spurious kernel warnings and the resulting compositor crashes observed
> when connecting/disconnecting DP MST monitors, while keeping the correct
> behavior of doing nothing when MST is not active. A drm_dbg_mst() trace
> is added so the skipped probe remains observable under MST debug logging.
>
> The existing WARN_ON(mgr->mst_primary) in drm_dp_mst_topology_mgr_set_mst()
> already catches the case where the topology is initialized twice, so no
> diagnostic coverage is lost.
>
> Fixes: dbaeef363ea5 ("drm/dp_mst: Add a helper to queue a topology probe")
> Cc: Imre Deak <[email protected]>
> Cc: Lyude Paul <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Jonas Emilsson <[email protected]>
> Signed-off-by: Luca Coelho <[email protected]>
Could also add maybe:
Link:
https://lore.kernel.org/all/[email protected]
The change looks ok:
Acked-by: Imre Deak <[email protected]>
> ---
b>
> Imre asked me to resend this with the small compilation fix as
> requested by Lyude.
>
> drivers/gpu/drm/display/drm_dp_mst_topology.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> index 4de36fda0544..7ce9e212770a 100644
> --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> @@ -3740,8 +3740,10 @@ void drm_dp_mst_topology_queue_probe(struct
> drm_dp_mst_topology_mgr *mgr)
> {
> mutex_lock(&mgr->lock);
>
> - if (drm_WARN_ON(mgr->dev, !mgr->mst_state || !mgr->mst_primary))
> + if (!mgr->mst_state || !mgr->mst_primary) {
> + drm_dbg_kms(mgr->dev, "queue_probe skipped: topology torn
> down\n");
> goto out_unlock;
> + }
>
> drm_dp_mst_topology_mgr_invalidate_mstb(mgr->mst_primary);
> drm_dp_mst_queue_probe_work(mgr);
> --
> 2.53.0
>