Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/dp_mst: Fix forced link retrain handling in MST HPD IRQ handler
@ 2026-03-11 15:31 Imre Deak
  2026-03-11 15:31 ` [PATCH 2/2] drm/i915/dp: Simplify forcing a link retraining Imre Deak
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Imre Deak @ 2026-03-11 15:31 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: Luca Coelho

Handling of a forced link retraining debugfs request via the DP MST HPD
IRQ handler is incorrectly skipped, if the IRQ handler doesn't see any
HPD IRQs raised by the sink. Fix this by ensuring that the request is
always handled (in the Fixes: commit below by directly calling
intel_dp_check_link_state(), later by the same call moved to
intel_dp_handle_link_service_irq()).

Cc: Luca Coelho <luciano.coelho@intel.com>
Fixes: db4855d90363 ("drm/i915/dp_mst: Reuse intel_dp_check_link_state() in the HPD IRQ handler")
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index fbb5e2f9c2414..2ae030eda73ee 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5575,11 +5575,13 @@ static bool
 intel_dp_check_mst_status(struct intel_dp *intel_dp)
 {
 	struct intel_display *display = to_intel_display(intel_dp);
+	bool force_retrain = intel_dp->link.force_retrain;
 	bool reprobe_needed = false;
 
 	for (;;) {
 		u8 esi[4] = {};
 		u8 ack[4] = {};
+		bool new_irqs;
 
 		if (!intel_dp_get_sink_irq_esi(intel_dp, esi)) {
 			drm_dbg_kms(display->drm,
@@ -5595,20 +5597,28 @@ intel_dp_check_mst_status(struct intel_dp *intel_dp)
 
 		intel_dp_mst_hpd_irq(intel_dp, esi, ack);
 
-		if (mem_is_zero(ack, sizeof(ack)))
-			break;
+		new_irqs = !mem_is_zero(ack, sizeof(ack));
 
 		drm_WARN_ON(display->drm, ack[1] & ~INTEL_DP_DEVICE_SERVICE_IRQ_MASK_MST);
 		drm_WARN_ON(display->drm, ack[3] & ~INTEL_DP_LINK_SERVICE_IRQ_MASK_MST);
 
-		if (!intel_dp_ack_sink_irq_esi(intel_dp, ack))
+		if (new_irqs && !intel_dp_ack_sink_irq_esi(intel_dp, ack))
 			drm_dbg_kms(display->drm, "Failed to ack ESI\n");
 
 		if (ack[1] & (DP_DOWN_REP_MSG_RDY | DP_UP_REQ_MSG_RDY))
 			drm_dp_mst_hpd_irq_send_new_request(&intel_dp->mst.mgr);
 
+		if (force_retrain) {
+			/* Defer forced retraining to the regular link status check. */
+			ack[3] |= LINK_STATUS_CHANGED;
+			force_retrain = false;
+		}
+
 		if (intel_dp_handle_link_service_irq(intel_dp, ack[3]))
 			reprobe_needed = true;
+
+		if (!new_irqs)
+			break;
 	}
 
 	return !reprobe_needed;
-- 
2.49.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-12  8:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-11 15:31 [PATCH 1/2] drm/i915/dp_mst: Fix forced link retrain handling in MST HPD IRQ handler Imre Deak
2026-03-11 15:31 ` [PATCH 2/2] drm/i915/dp: Simplify forcing a link retraining Imre Deak
2026-03-12  5:17   ` Kandpal, Suraj
2026-03-11 16:32 ` ✓ CI.KUnit: success for series starting with [1/2] drm/i915/dp_mst: Fix forced link retrain handling in MST HPD IRQ handler Patchwork
2026-03-11 17:07 ` ✓ Xe.CI.BAT: " Patchwork
2026-03-12  4:59 ` [PATCH 1/2] " Kandpal, Suraj
2026-03-12  8:08 ` ✓ Xe.CI.FULL: success for series starting with [1/2] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox