All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: [Intel-gfx] [PATCH] drm/i915/mst: Make sure all resources are freed for MST topology manager before destroy
Date: Wed,  7 Jun 2023 15:49:41 +0300	[thread overview]
Message-ID: <20230607124941.19016-1-stanislav.lisovskiy@intel.com> (raw)

In some of the CI failures we have see a race condition, when we were getting
continuous hpd pulses, forcing DP MST topology manager to try handling them,
however if this is combined with module reload that might cause it
to try destroying the already locked mutex, also some workqueue might attempt
to use already freed encoder resources, because
drm_dp_mst_topology_mgr_destroy doesn't check if mutex is still locked(triggers
WARN) and flushes only one drm_dp_mst_link_probe_work queue, while others, like
drm_dp_mst_up_req_work might be running at the moment, especially in case if
due to some other sw/hw bug, we are constantly getting hpd pulses from MST device.
Best way would be to modify drm_dp_mst_topology_mgr_destroy function itself, however
as it might take way more time, for now lets try to call drm_dp_mst_topology_mgr_suspend
first, which seems to do all the required actions.

Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_mst.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
index 3ba4a2fef98a..9c587b40cf42 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
@@ -1298,6 +1298,7 @@ intel_dp_mst_encoder_cleanup(struct intel_digital_port *dig_port)
 	if (!intel_dp_mst_source_support(intel_dp))
 		return;
 
+	drm_dp_mst_topology_mgr_suspend(&intel_dp->mst_mgr);
 	drm_dp_mst_topology_mgr_destroy(&intel_dp->mst_mgr);
 	/* encoders will get killed by normal cleanup */
 
-- 
2.37.3


             reply	other threads:[~2023-06-07 12:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-07 12:49 Stanislav Lisovskiy [this message]
2023-06-07 22:38 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/mst: Make sure all resources are freed for MST topology manager before destroy Patchwork
2023-06-07 22:52 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-06-08 15:42 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230607124941.19016-1-stanislav.lisovskiy@intel.com \
    --to=stanislav.lisovskiy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.