* [PATCH] drm/i915/dp: Clear accumulated HPD events after link training
@ 2026-04-08 8:45 Chia-Lin Kao (AceLan)
2026-04-12 2:53 ` Claude review: " Claude Code Review Bot
2026-04-12 2:53 ` Claude Code Review Bot
0 siblings, 2 replies; 3+ messages in thread
From: Chia-Lin Kao (AceLan) @ 2026-04-08 8:45 UTC (permalink / raw)
To: Jani Nikula, Rodrigo Vivi, Joonas Lahtinen, Tvrtko Ursulin,
David Airlie, Simona Vetter
Cc: intel-gfx, intel-xe, dri-devel, linux-kernel
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@canonical.com>
---
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Claude review: drm/i915/dp: Clear accumulated HPD events after link training
2026-04-08 8:45 [PATCH] drm/i915/dp: Clear accumulated HPD events after link training Chia-Lin Kao (AceLan)
@ 2026-04-12 2:53 ` Claude Code Review Bot
2026-04-12 2:53 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 2:53 UTC (permalink / raw)
To: dri-devel-reviews
Overall Series Review
Subject: drm/i915/dp: Clear accumulated HPD events after link training
Author: "Chia-Lin Kao (AceLan)" <acelan.kao@canonical.com>
Patches: 1
Reviewed: 2026-04-12T12:53:17.132011
---
This is a single, well-focused patch addressing a real hardware issue: GPU hard lockups on MST hubs (specifically Dell U2721DE with Realtek MST hub) caused by stale HPD events being replayed after link training completes.
The fix is minimal and uses an existing API (`intel_hpd_clear_and_unblock()`) that was designed precisely for this purpose — it is already used in `intel_crt.c:575` for an analogous "discard stale events after detection" scenario. The approach is sound: events accumulated while HPD was blocked during link training are stale (they reflect pre-retrain link state), and processing them after a successful retrain creates a burst of work that races with the modeset pipeline. The scheduled `intel_encoder_link_check_queue_work()` call at line 1161 provides a safety net for detecting any legitimate link issues post-retrain.
**Verdict: Looks good.** One minor observation below.
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
* Claude review: drm/i915/dp: Clear accumulated HPD events after link training
2026-04-08 8:45 [PATCH] drm/i915/dp: Clear accumulated HPD events after link training Chia-Lin Kao (AceLan)
2026-04-12 2:53 ` Claude review: " Claude Code Review Bot
@ 2026-04-12 2:53 ` Claude Code Review Bot
1 sibling, 0 replies; 3+ messages in thread
From: Claude Code Review Bot @ 2026-04-12 2:53 UTC (permalink / raw)
To: dri-devel-reviews
Patch Review
**Correctness:**
The block/unblock pairing is correct:
- `intel_dp_start_link_train()` calls `intel_hpd_block(encoder)` at line 1655
- `intel_dp_stop_link_train()` calls the unblock at line 1155
The change from `intel_hpd_unblock()` (which calls `queue_work_for_missed_irqs()` to replay accumulated events) to `intel_hpd_clear_and_unblock()` (which clears `event_bits`, `retry_bits`, `short_hpd_pin_mask`, and `long_hpd_pin_mask`) is the right approach. The cleared events genuinely are stale — they were generated during link training and reflect pre-retrain link status.
**Safety net:**
The commit message correctly identifies that the safety net exists at lines 1157-1162:
```c
if (!display->hotplug.ignore_long_hpd &&
intel_dp->link.seq_train_failures < MAX_SEQ_TRAIN_FAILURES) {
int delay_ms = intel_dp->link.seq_train_failures ? 0 : 2000;
intel_encoder_link_check_queue_work(encoder, delay_ms);
}
```
This queues a link check after 2 seconds (on first success), which will catch any legitimate link degradation post-retrain. Any *new* HPD events arriving after the unblock are processed normally through the standard path.
**Minor observation:**
The commit message could benefit from a `Fixes:` or `Cc: stable@` tag if this is intended for backporting, given that it fixes a GPU hard lockup. The commit that introduced `intel_hpd_block()`/`intel_hpd_unblock()` in the link training path would be the appropriate `Fixes:` target. This doesn't affect the code quality, but would help with stable kernel backporting.
**Overall:** Clean, minimal, correct fix. The commit message is well-written and explains both the problem (stale HPD burst racing with modeset) and why the fix is safe (events are stale + link check safety net).
---
Generated by Claude Code Patch Reviewer
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-04-12 2:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-08 8:45 [PATCH] drm/i915/dp: Clear accumulated HPD events after link training Chia-Lin Kao (AceLan)
2026-04-12 2:53 ` Claude review: " Claude Code Review Bot
2026-04-12 2:53 ` Claude Code Review Bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox