From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: [PATCH v6 5/6] drm/i915/dp: Queue a link check after link training is complete
Date: Wed, 5 Mar 2025 13:48:20 +0200 [thread overview]
Message-ID: <20250305114820.3523077-2-imre.deak@intel.com> (raw)
In-Reply-To: <20250304152917.3407080-6-imre.deak@intel.com>
After link training - both in case of a passing and failing LT result -
a work is scheduled to check the link state. This check should take
place after the link training is completed by disabling the link
training pattern and setting intel_dp::link_trained=true. Atm, the work
is scheduled before these steps, which may result in checking the link
state too early (and thus not retraining the link as expected).
Fix the above by scheduling the link check work after link training is
complete.
v2:
- Add MAX_SEQ_TRAIN_FAILURES instead of open-coding it. (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
.../gpu/drm/i915/display/intel_dp_link_training.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
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 3906c11acc968..384eb615caf64 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -56,6 +56,8 @@
lt_dbg(_intel_dp, _dp_phy, "Sink disconnected: " _format, ## __VA_ARGS__); \
} while (0)
+#define MAX_SEQ_TRAIN_FAILURES 2
+
static void intel_dp_reset_lttpr_common_caps(struct intel_dp *intel_dp)
{
memset(intel_dp->lttpr_common_caps, 0, sizeof(intel_dp->lttpr_common_caps));
@@ -1110,6 +1112,7 @@ intel_dp_128b132b_intra_hop(struct intel_dp *intel_dp,
void intel_dp_stop_link_train(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state)
{
+ struct intel_display *display = to_intel_display(intel_dp);
struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
intel_dp->link_trained = true;
@@ -1124,6 +1127,13 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp,
}
intel_hpd_unblock(encoder);
+
+ 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);
+ }
}
static bool
@@ -1628,7 +1638,6 @@ void intel_dp_start_link_train(struct intel_atomic_state *state,
lt_dbg(intel_dp, DP_PHY_DPRX, "Forcing link training failure\n");
} else if (passed) {
intel_dp->link.seq_train_failures = 0;
- intel_encoder_link_check_queue_work(encoder, 2000);
return;
}
@@ -1651,10 +1660,8 @@ void intel_dp_start_link_train(struct intel_atomic_state *state,
return;
}
- if (intel_dp->link.seq_train_failures < 2) {
- intel_encoder_link_check_queue_work(encoder, 0);
+ if (intel_dp->link.seq_train_failures < MAX_SEQ_TRAIN_FAILURES)
return;
- }
if (intel_dp_schedule_fallback_link_training(state, intel_dp, crtc_state))
return;
--
2.44.2
next prev parent reply other threads:[~2025-03-05 11:48 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 15:29 [PATCH v5 0/6] drm/i915/dp: Fix link training interrupted by HPD pulse Imre Deak
2025-03-04 15:29 ` [PATCH v5 1/6] drm/i915/hpd: Track HPD pins instead of ports for HPD pulse events Imre Deak
2025-03-04 16:08 ` Jani Nikula
2025-03-04 15:29 ` [PATCH v5 2/6] drm/i915/hpd: Let an HPD pin be in the disabled state when handling missed IRQs Imre Deak
2025-03-04 16:08 ` Jani Nikula
2025-03-04 15:29 ` [PATCH v5 3/6] drm/i915/hpd: Add support for blocking the IRQ handling on an HPD pin Imre Deak
2025-03-04 17:02 ` Jani Nikula
2025-03-04 19:50 ` Imre Deak
2025-03-05 11:48 ` [PATCH v6 " Imre Deak
2025-03-07 12:32 ` Jani Nikula
2025-03-04 15:29 ` [PATCH v5 4/6] drm/i915/dp: Fix link training interrupted by a short HPD pulse Imre Deak
2025-03-04 17:03 ` Jani Nikula
2025-03-04 15:29 ` [PATCH v5 5/6] drm/i915/dp: Queue a link check after link training is complete Imre Deak
2025-03-04 17:56 ` Jani Nikula
2025-03-04 19:59 ` Imre Deak
2025-03-05 11:48 ` Imre Deak [this message]
2025-03-04 15:29 ` [PATCH v5 6/6] drm/i915/crt: Use intel_hpd_block/unblock() instead of intel_hpd_disable/enable() Imre Deak
2025-03-07 12:34 ` Jani Nikula
2025-03-04 16:22 ` ✓ CI.Patch_applied: success for drm/i915/dp: Fix link training interrupted by HPD pulse Patchwork
2025-03-04 16:23 ` ✓ CI.checkpatch: " Patchwork
2025-03-04 16:24 ` ✓ CI.KUnit: " Patchwork
2025-03-04 16:40 ` ✓ CI.Build: " Patchwork
2025-03-04 16:43 ` ✓ CI.Hooks: " Patchwork
2025-03-04 16:46 ` ✗ CI.checksparse: warning " Patchwork
2025-03-04 17:04 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-04 18:05 ` ✗ Xe.CI.Full: failure " Patchwork
2025-03-05 18:18 ` ✓ CI.Build: success for drm/i915/dp: Fix link training interrupted by HPD pulse (rev3) Patchwork
2025-03-05 18:20 ` ✓ CI.Hooks: " Patchwork
2025-03-05 18:22 ` ✗ CI.checksparse: warning " Patchwork
2025-03-05 18:41 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-05 19:59 ` ✗ Xe.CI.Full: failure for drm/i915/dp: Fix link training interrupted by HPD pulse (rev2) Patchwork
2025-03-05 21:27 ` ✗ Xe.CI.Full: failure for drm/i915/dp: Fix link training interrupted by HPD pulse (rev3) Patchwork
[not found] ` <174120906736.44240.15420770152155295918@64e06c682a23>
2025-03-11 14:37 ` ✗ i915.CI.Full: " Imre Deak
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=20250305114820.3523077-2-imre.deak@intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox