Skip to content

Commit d4cb3fd

Browse files
matt-auldvsyrjala
authored andcommitted
drm/i915/dp: add lane_count check in intel_dp_check_link_status
Currently it's entirely possible to go through the link training step without first determining the lane_count, which is silly since we end up doing a bunch of aux transfers of size = 0, as highlighted by WARN_ON(!msg->buffer != !msg->size), and can only ever result in a 'failed to update link training' message. This can be observed during intel_dp_long_pulse where we can do the link training step, but before we have had a chance to set the link params. To avoid this we add an extra check for the lane_count in intel_dp_check_link_status, which should prevent us from doing the link training step prematurely. v2: add WARN_ON_ONCE and FIXME comment (Ville) References: https://bugs.freedesktop.org/show_bug.cgi?id=97344 Cc: Ville Syrjälä <[email protected]> Cc: Mika Kahola <[email protected]> Signed-off-by: Matthew Auld <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Ville Syrjälä <[email protected]>
1 parent c8a89b0 commit d4cb3fd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4041,6 +4041,11 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
40414041
if (!to_intel_crtc(intel_encoder->base.crtc)->active)
40424042
return;
40434043

4044+
/* FIXME: we need to synchronize this sort of stuff with hardware
4045+
* readout */
4046+
if (WARN_ON_ONCE(!intel_dp->lane_count))
4047+
return;
4048+
40444049
/* if link training is requested we should perform it always */
40454050
if ((intel_dp->compliance_test_type == DP_TEST_LINK_TRAINING) ||
40464051
(!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count))) {

0 commit comments

Comments
 (0)