[PATCH] drm/i915/dp: Clear accumulated HPD events after link training

From: Chia-Lin Kao (AceLan)

Date: Wed Apr 08 2026 - 04:48:43 EST


After link training completes, intel_dp_stop_link_train() calls
intel_hpd_unblock() which fires all HPD events that accumulated
during training via queue_work_for_missed_irqs(). On MST hubs that
generate rapid short HPD pulses (observed at 5-55ms intervals on
Dell U2721DE with Realtek MST hub), this creates a burst of stale
ESI processing that races with the ongoing modeset pipeline enabling
the 2nd MST stream, resulting in a GPU hard lockup.

Use intel_hpd_clear_and_unblock() instead, which clears the
accumulated HPD events before unblocking. These events are stale
since they reflect link status before the successful retrain. Any
new HPD events arriving after the unblock will be processed normally,
and the scheduled link check (intel_encoder_link_check_queue_work)
provides a safety net for detecting legitimate link issues.

Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao@xxxxxxxxxxxxx>
---
drivers/gpu/drm/i915/display/intel_dp_link_training.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index a26094223f780..4de2b3d3ea21c 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -1267,7 +1267,7 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,
lt_dbg(intel_dp, DP_PHY_DPRX, "128b/132b intra-hop not clearing\n");
}

- intel_hpd_unblock(encoder);
+ intel_hpd_clear_and_unblock(encoder);

if (!display->hotplug.ignore_long_hpd &&
intel_dp->link.seq_train_failures < MAX_SEQ_TRAIN_FAILURES) {
--
2.53.0