* [PATCH] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe()
@ 2026-05-03 3:45 Jonas Emilsson
2026-05-04 17:04 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jonas Emilsson @ 2026-05-03 3:45 UTC (permalink / raw)
To: dri-devel; +Cc: Jonas Emilsson, Imre Deak, Lyude Paul, stable, intel-gfx
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 <imre.deak@intel.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: stable@vger.kernel.org
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Jonas Emilsson <jonas.emilsson@gmail.com>
---
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 8757972e8..0cb341ce1 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -3738,8 +3738,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_mst(mgr->dev, "queue_probe skipped: topology torn down\n");
goto out_unlock;
+ }
drm_dp_mst_topology_mgr_invalidate_mstb(mgr->mst_primary);
--
2.51.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* ✗ LGCI.VerificationFailed: failure for drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe()
2026-05-03 3:45 [PATCH] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe() Jonas Emilsson
@ 2026-05-04 17:04 ` Patchwork
2026-05-07 18:23 ` [PATCH] " lyude
2026-05-07 18:45 ` lyude
2 siblings, 0 replies; 4+ messages in thread
From: Patchwork @ 2026-05-04 17:04 UTC (permalink / raw)
To: Jonas Emilsson; +Cc: intel-gfx
== Series Details ==
Series: drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe()
URL : https://patchwork.freedesktop.org/series/165902/
State : failure
== Summary ==
Address 'jonas.emilsson@gmail.com' is not on the allowlist, which prevents CI from being triggered for this patch.
If you want Intel GFX CI to accept this address, please contact the script maintainers at i915-ci-infra@lists.freedesktop.org.
Exception occurred during validation, bailing out!
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe()
2026-05-03 3:45 [PATCH] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe() Jonas Emilsson
2026-05-04 17:04 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
@ 2026-05-07 18:23 ` lyude
2026-05-07 18:45 ` lyude
2 siblings, 0 replies; 4+ messages in thread
From: lyude @ 2026-05-07 18:23 UTC (permalink / raw)
To: Jonas Emilsson, dri-devel; +Cc: Imre Deak, stable, intel-gfx
Reviewed-by: Lyude Paul <lyude@redhat.com>
Will push upstream in just a moment
On Sun, 2026-05-03 at 05:45 +0200, Jonas Emilsson 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 <imre.deak@intel.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: stable@vger.kernel.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Jonas Emilsson <jonas.emilsson@gmail.com>
> ---
> 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 8757972e8..0cb341ce1 100644
> --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> @@ -3738,8 +3738,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_mst(mgr->dev, "queue_probe skipped: topology
> torn down\n");
> goto out_unlock;
> + }
>
> drm_dp_mst_topology_mgr_invalidate_mstb(mgr->mst_primary);
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe()
2026-05-03 3:45 [PATCH] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe() Jonas Emilsson
2026-05-04 17:04 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-05-07 18:23 ` [PATCH] " lyude
@ 2026-05-07 18:45 ` lyude
2 siblings, 0 replies; 4+ messages in thread
From: lyude @ 2026-05-07 18:45 UTC (permalink / raw)
To: Jonas Emilsson, dri-devel; +Cc: Imre Deak, stable, intel-gfx
Actually sorry - I need to take back the r-b, there's a couple of
issues in this patch that I didn't immediately notice because it had
trouble applying (though I don't have a clue why)
On Sun, 2026-05-03 at 05:45 +0200, Jonas Emilsson 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 <imre.deak@intel.com>
> Cc: Lyude Paul <lyude@redhat.com>
> Cc: stable@vger.kernel.org
> Cc: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Jonas Emilsson <jonas.emilsson@gmail.com>
> ---
> 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 8757972e8..0cb341ce1 100644
> --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> @@ -3738,8 +3738,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_mst(mgr->dev, "queue_probe skipped: topology
> torn down\n");
There is no such function named drm_dbg_mst, can you switch this to
drm_dbg_kms() like the rest of the file and make sure it builds before
sending another version?
> goto out_unlock;
> + }
>
> drm_dp_mst_topology_mgr_invalidate_mstb(mgr->mst_primary);
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-07 18:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-03 3:45 [PATCH] drm/dp_mst: Handle torn-down topology gracefully in drm_dp_mst_topology_queue_probe() Jonas Emilsson
2026-05-04 17:04 ` ✗ LGCI.VerificationFailed: failure for " Patchwork
2026-05-07 18:23 ` [PATCH] " lyude
2026-05-07 18:45 ` lyude
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox