Skip to contentSkip to conversation

drm/i915/dp: Fix link retrain loop on pre-gen8 platforms with DP adapters

PATCH In review bitey 3 participants 4 messages Apr 30 – May 4

Subsystems (3)
lore
Share & tools
lore

bitey

author
#0 lore raw

PATCH 1/1 drm/i915/dp: Fix link retrain loop on pre-gen8 platforms with DP adapters

On Ivy Bridge (and other pre-gen8 platforms), active DP-to-HDMI protocol converters such as the Chrontel CH73111 trigger an infinite link retrain loop on kernels 6.x+. The monitor connected through the adapter goes black and recovers approximately once per second, eventually causing system instability.

Three changes introduced in the i915 DP stack combine to cause this:

1. intel_dp_stop_link_train() now automatically schedules a post-training link check via intel_encoder_link_check_queue_work(). The Chrontel adapter reports non-standard DPCD link status, which causes the check to fail and trigger a retrain, looping indefinitely.

2. intel_dp_needs_link_retrain() unconditionally returns true when seq_train_failures > 0, bypassing the actual DPCD link status read. A single marginal training attempt permanently marks the link as needing retrain.

3. intel_dp_short_pulse() forces LINK_STATUS_CHANGED on every short HPD for all platforms, causing unnecessary link checks that initiate the retrain cycle on adapters that generate frequent short HPDs.

Fix all three by gating the new behavior behind DISPLAY_VER(display) >= 8, restoring the 5.15-era behavior for Ivy Bridge/Sandy Bridge and earlier. These platforms use the older g4x DP path and do not benefit from the aggressive post-training link monitoring.

Tested on Intel HD 2500 (Ivy Bridge, device ID 0152) with a Chrontel CH73111 DP-to-HDMI adapter driving a 1920x1080 display over 2 lanes at HBR (270 MHz).

---
 drivers/gpu/drm/i915/display/intel_dp.c              | 8 +++++++-
 drivers/gpu/drm/i915/display/intel_dp_link_training.c | 3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +6 -2
index ORIGINAL..FIXED 100644
@@ -5676,6 +5676,7 @@ static int
 intel_dp_read_link_status(struct intel_dp *intel_dp,
 			  u8 link_status[DP_LINK_STATUS_SIZE])
 {
+	struct intel_display *display = to_intel_display(intel_dp);
 	int err;
 
 	memset(link_status, 0, DP_LINK_STATUS_SIZE);
@@ -5712,7 +5713,8 @@ static bool intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
 	if (intel_dp->link.retrain_disabled)
 		return false;
 
-	if (intel_dp->link.seq_train_failures)
+	if (DISPLAY_VER(display) >= 8 &&
+	    intel_dp->link.seq_train_failures)
 		return true;
 
 	/* Retrain if link not ok */
@@ -5965,6 +5967,7 @@ static bool
 intel_dp_short_pulse(struct intel_dp *intel_dp)
 {
+	struct intel_display *display = to_intel_display(intel_dp);
 	bool reprobe_needed = false;
 	u8 esi[4] = {};
 
@@ -5988,7 +5991,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)
 	 * TODO: let the link status check depend on LINK_STATUS_CHANGED
 	 * or intel_dp->link.force_retrain for DPCD_REV >= 1.2
 	 */
-	esi[3] |= LINK_STATUS_CHANGED;
+	if (DISPLAY_VER(display) >= 8)
+		esi[3] |= LINK_STATUS_CHANGED;
 	if (intel_dp_handle_link_service_irq(intel_dp, esi[3]))
 		reprobe_needed = true;
 
drivers/gpu/drm/i915/display/intel_dp_link_training.c +2 -1
index ORIGINAL..FIXED 100644
@@ -1154,7 +1154,8 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,
 
 	intel_hpd_unblock(encoder);
 
-	if (!display->hotplug.ignore_long_hpd &&
+	if (DISPLAY_VER(display) >= 8 &&
+	    !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;
 
Signature · 1 line
2.49.0
maintainer
#1 lore raw
Quoted 22 lines · bitey

On Ivy Bridge (and other pre-gen8 platforms), active DP-to-HDMI protocol converters such as the Chrontel CH73111 trigger an infinite link retrain loop on kernels 6.x+. The monitor connected through the adapter goes black and recovers approximately once per second, eventually causing system instability.

Three changes introduced in the i915 DP stack combine to cause this:

1. intel_dp_stop_link_train() now automatically schedules a post-training link check via intel_encoder_link_check_queue_work(). The Chrontel adapter reports non-standard DPCD link status, which causes the check to fail and trigger a retrain, looping indefinitely.

2. intel_dp_needs_link_retrain() unconditionally returns true when seq_train_failures > 0, bypassing the actual DPCD link status read. A single marginal training attempt permanently marks the link as needing retrain.

3. intel_dp_short_pulse() forces LINK_STATUS_CHANGED on every short HPD for all platforms, causing unnecessary link checks that initiate the retrain cycle on adapters that generate frequent short HPDs.

Quoted 8 lines

Fix all three by gating the new behavior behind DISPLAY_VER(display) >= 8, restoring the 5.15-era behavior for Ivy Bridge/Sandy Bridge and earlier. These platforms use the older g4x DP path and do not benefit from the aggressive post-training link monitoring.

Tested on Intel HD 2500 (Ivy Bridge, device ID 0152) with a Chrontel CH73111 DP-to-HDMI adapter driving a 1920x1080 display over 2 lanes at HBR (270 MHz).

Please file a bug over at [1] with the full dmesg reproducing the issues, and reply with the link to the bug.

Thanks,
Jani.

[1] https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html

Quoted 59 lines
---
 drivers/gpu/drm/i915/display/intel_dp.c              | 8 +++++++-
 drivers/gpu/drm/i915/display/intel_dp_link_training.c | 3 ++-
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_dp.c +6 -2
index ORIGINAL..FIXED 100644
@@ -5676,6 +5676,7 @@ static int
 intel_dp_read_link_status(struct intel_dp *intel_dp,
 			  u8 link_status[DP_LINK_STATUS_SIZE])
 {
+	struct intel_display *display = to_intel_display(intel_dp);
 	int err;
 
 	memset(link_status, 0, DP_LINK_STATUS_SIZE);
@@ -5712,7 +5713,8 @@ static bool intel_dp_needs_link_retrain(struct intel_dp *intel_dp)
 	if (intel_dp->link.retrain_disabled)
 		return false;
 
-	if (intel_dp->link.seq_train_failures)
+	if (DISPLAY_VER(display) >= 8 &&
+	    intel_dp->link.seq_train_failures)
 		return true;
 
 	/* Retrain if link not ok */
@@ -5965,6 +5967,7 @@ static bool
 intel_dp_short_pulse(struct intel_dp *intel_dp)
 {
+	struct intel_display *display = to_intel_display(intel_dp);
 	bool reprobe_needed = false;
 	u8 esi[4] = {};
 
@@ -5988,7 +5991,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)
 	 * TODO: let the link status check depend on LINK_STATUS_CHANGED
 	 * or intel_dp->link.force_retrain for DPCD_REV >= 1.2
 	 */
-	esi[3] |= LINK_STATUS_CHANGED;
+	if (DISPLAY_VER(display) >= 8)
+		esi[3] |= LINK_STATUS_CHANGED;
 	if (intel_dp_handle_link_service_irq(intel_dp, esi[3]))
 		reprobe_needed = true;
 
drivers/gpu/drm/i915/display/intel_dp_link_training.c +2 -1
index ORIGINAL..FIXED 100644
@@ -1154,7 +1154,8 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,
 
 	intel_hpd_unblock(encoder);
 
-	if (!display->hotplug.ignore_long_hpd &&
+	if (DISPLAY_VER(display) >= 8 &&
+	    !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;
Signature · 1 line
Jani Nikula, Intel
#2 lore raw

Hi Jani,

Thank you for the pointer. I've filed the bug here:
https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/15994
The full dmesg, hardware details, root cause analysis, and proposed fix are all in the issue.

Best regards,
Кусь

Quoted 118 lines

Четверг, 30 апреля 2026, 10:45 +03:00 от Jani Nikula <[email protected]

Quoted 1 line

:

Quoted 11 lines · bitey

On Ivy Bridge (and other pre-gen8 platforms), active DP-to-HDMI protocol

converters such as the Chrontel CH73111 trigger an infinite link retrain

loop on kernels 6.x+. The monitor connected through the adapter goes black and recovers approximately once per second, eventually causing system instability.

Three changes introduced in the i915 DP stack combine to cause this:

1. intel_dp_stop_link_train() now automatically schedules a

post-training

Quoted 9 lines

link check via intel_encoder_link_check_queue_work(). The Chrontel adapter reports non-standard DPCD link status, which causes the check to fail and trigger a retrain, looping indefinitely.

2. intel_dp_needs_link_retrain() unconditionally returns true when seq_train_failures > 0, bypassing the actual DPCD link status read. A single marginal training attempt permanently marks the link as needing retrain.

Quoted 5 lines

3. intel_dp_short_pulse() forces LINK_STATUS_CHANGED on every short HPD for all platforms, causing unnecessary link checks that initiate the retrain cycle on adapters that generate frequent short HPDs.

Fix all three by gating the new behavior behind DISPLAY_VER(display) >=

8,

Quoted 8 lines

restoring the 5.15-era behavior for Ivy Bridge/Sandy Bridge and earlier.

These platforms use the older g4x DP path and do not benefit from the aggressive post-training link monitoring.

Tested on Intel HD 2500 (Ivy Bridge, device ID 0152) with a Chrontel CH73111 DP-to-HDMI adapter driving a 1920x1080 display over 2 lanes at HBR (270 MHz).

Please file a bug over at [1] with the full dmesg reproducing the issues, and reply with the link to the bug.

Thanks,
Jani.

[1] https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html

Review

Quoted 8 lines

---
drivers/gpu/drm/i915/display/intel_dp.c | 8 +++++++- drivers/gpu/drm/i915/display/intel_dp_link_training.c | 3 ++-

2 files changed, 9 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/display/intel_dp.c

drivers/gpu/drm/i915/display/intel_dp.c static bool intel_dp_needs_link_retrain(struct

Quoted 12 lines

index ORIGINAL..FIXED 100644

drivers/gpu/drm/i915/display/intel_dp.c +1 -0
@@ -5676,6 +5676,7 @@ static int
 intel_dp_read_link_status(struct intel_dp *intel_dp,
 u8 link_status[DP_LINK_STATUS_SIZE])
 {
+ struct intel_display *display = to_intel_display(intel_dp);
 int err;
 
 memset(link_status, 0, DP_LINK_STATUS_SIZE);
@@ -5712,7 +5713,8 @@ static bool intel_dp_needs_link_retrain(struct

intel_dp *intel_dp)

Review

Quoted 27 lines
drivers/gpu/drm/i915/display/intel_dp.c +5 -2
 if (intel_dp->link.retrain_disabled)
 return false;
 
- if (intel_dp->link.seq_train_failures)
+ if (DISPLAY_VER(display) >= 8 &&
+ intel_dp->link.seq_train_failures)
 return true;
 
 /* Retrain if link not ok */
@@ -5965,6 +5967,7 @@ static bool
 intel_dp_short_pulse(struct intel_dp *intel_dp)
 {
+ struct intel_display *display = to_intel_display(intel_dp);
 bool reprobe_needed = false;
 u8 esi[4] = {};
 
@@ -5988,7 +5991,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)
 * TODO: let the link status check depend on LINK_STATUS_CHANGED
 * or intel_dp->link.force_retrain for DPCD_REV >= 1.2
 */
- esi[3] |= LINK_STATUS_CHANGED;
+ if (DISPLAY_VER(display) >= 8)
+ esi[3] |= LINK_STATUS_CHANGED;
 if (intel_dp_handle_link_service_irq(intel_dp, esi[3]))
 reprobe_needed = true;
 
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/display/intel_dp_link_training.c

drivers/gpu/drm/i915/display/intel_dp_link_training.c void intel_dp_stop_link_train(struct intel_dp

Quoted 4 lines

index ORIGINAL..FIXED 100644

drivers/gpu/drm/i915/display/intel_dp_link_training.c +0 -0
@@ -1154,7 +1154,8 @@ void intel_dp_stop_link_train(struct intel_dp

*intel_dp,

drivers/gpu/drm/i915/display/intel_dp_link_training.c void intel_dp_stop_link_train(struct intel_dp *intel_dp, · line 1160

Quoted 8 lines
drivers/gpu/drm/i915/display/intel_dp_link_training.c +2 -1
 intel_hpd_unblock(encoder);
 
- if (!display->hotplug.ignore_long_hpd &&
+ if (DISPLAY_VER(display) >= 8 &&
+ !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;

--
Jani Nikula, Intel

#3 lore raw

✗ LGCI.VerificationFailed: failure for drm/i915/dp: Fix link retrain loop on pre-gen8 platforms with DP adapters

In reply to bitey
== Series Details ==

== Series Details ==

Series: drm/i915/dp: Fix link retrain loop on pre-gen8 platforms with DP adapters
URL : https://patchwork.freedesktop.org/series/165800/
State : failure

== Summary ==

Address '[email protected]' 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 [email protected]. Exception occurred during validation, bailing out!