From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7460844AB85; Thu, 30 Jul 2026 16:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427935; cv=none; b=iBCl2d4Au4RyBKLfVty8TtkvEW1q9WxIN/3uUXIm0L/4rgWem/5AEHa7T1t5sQg1xrjSmj6veTVh5EHNSAq4LVaUDNQIiHdhhYoQAOkOM8X2UGBCw/vb9PJgEu0p2rogfC7NuXeg3iEEBHm+w4L7D7VZ/Iwbe41rC+AgOiO9ZEk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785427935; c=relaxed/simple; bh=TB3oEiDRNT8tYE1B9iXRlPGp6BcOsHkFlAKlnBZtD3U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h9jX6/0bR67KI1CA4RgW5W2+f/Xxw77qL5la3jej7lwtm3cjv+MvSYuOw1X4EAUdogaGfo562dOAaGPNwo/gpxEsFPbU1g9M+Ej/713PQdceDo9BVlTHki9mx7DxFUybCjozRJg2s22Hskl3R2pK3CcJYuF0qln20QaCB4mPMGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pygnvCSD; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="pygnvCSD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D064F1F000E9; Thu, 30 Jul 2026 16:12:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1785427934; bh=DBhisfqYdZklcLM0upm6FYC2HPp+1QFxJtEGFSY8zvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=pygnvCSDIsSju2SFlK/52Deqzmd+Y03OXDSDz6r0nLzHLsZc+7jr4MulkwawxkbSj XDyb4QXKH9WLvDPNSpudIqG57N60EZ6K3qG3KlLYGJafX8PntHARyyFamnYeTqtDF2 szDz9+g+BzGcVnm2Lu17Xnq0QjKZDyYZJ+BwBhMk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Imre Deak , Lyude Paul , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Jonas Emilsson , Luca Coelho , Maarten Lankhorst Subject: [PATCH 6.6 345/484] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe() Date: Thu, 30 Jul 2026 16:14:02 +0200 Message-ID: <20260730141430.976711145@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260730141423.392222816@linuxfoundation.org> References: <20260730141423.392222816@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luca Coelho commit 613059875958e7b217b250ed14c3b189f9488421 upstream. 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 Cc: Lyude Paul Cc: stable@vger.kernel.org Cc: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org Signed-off-by: Jonas Emilsson Signed-off-by: Luca Coelho Link: https://lore.kernel.org/all/20260503034533.1023686-1-jonas.emilsson@gmail.com Acked-by: Imre Deak Link: https://patch.msgid.link/20260622140532.526722-1-luciano.coelho@intel.com Signed-off-by: Maarten Lankhorst Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/display/drm_dp_mst_topology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c @@ -3703,8 +3703,10 @@ void drm_dp_mst_topology_queue_probe(str { 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);