Skip to contentSkip to conversation

Revert "drm/i915: Implement Link Rate fallback on Link training failure"

PATCH In review Daniel Vetter 7 participants 13 messages Mar 1, 2017 – Mar 14, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "drm/i915: Implement Link Rate fallback on Link training failure"

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Cc Jani Nikula <[email protected]>
Cc Manasi Navare <[email protected]>
---
 drivers/gpu/drm/i915/intel_dp.c               | 27 ---------------------------
 drivers/gpu/drm/i915/intel_dp_link_training.c | 22 ++--------------------
 drivers/gpu/drm/i915/intel_drv.h              |  3 ---
 3 files changed, 2 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -27
index af07a830fa95..d1670b8afbf5 100644
@@ -5790,29 +5790,6 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 	return false;
 }
 
-static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
-{
-	struct intel_connector *intel_connector;
-	struct drm_connector *connector;
-
-	intel_connector = container_of(work, typeof(*intel_connector),
-				       modeset_retry_work);
-	connector = &intel_connector->base;
-	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
-		      connector->name);
-
-	/* Grab the locks before changing connector property*/
-	mutex_lock(&connector->dev->mode_config.mutex);
-	/* Set connector link status to BAD and send a Uevent to notify
-	 * userspace to do a modeset.
-	 */
-	drm_mode_connector_set_link_status_property(connector,
-						    DRM_MODE_LINK_STATUS_BAD);
-	mutex_unlock(&connector->dev->mode_config.mutex);
-	/* Send Hotplug uevent so userspace can reprobe */
-	drm_kms_helper_hotplug_event(connector->dev);
-}
-
 bool
 intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 			struct intel_connector *intel_connector)
@@ -5825,10 +5802,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 	enum port port = intel_dig_port->port;
 	int type;
 
-	/* Initialize the work for modeset in case of link train failure */
-	INIT_WORK(&intel_connector->modeset_retry_work,
-		  intel_dp_modeset_retry_work_fn);
-
 	if (WARN(intel_dig_port->max_lanes < 1,
 		 "Not enough lanes (%d) for DP on port %c\n",
 		 intel_dig_port->max_lanes, port_name(port)))
drivers/gpu/drm/i915/intel_dp_link_training.c +2 -20
index 955b239e7c2d..0048b520baf7 100644
@@ -313,24 +313,6 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp)
 void
 intel_dp_start_link_train(struct intel_dp *intel_dp)
 {
-	struct intel_connector *intel_connector = intel_dp->attached_connector;
-
-	if (!intel_dp_link_training_clock_recovery(intel_dp))
-		goto failure_handling;
-	if (!intel_dp_link_training_channel_equalization(intel_dp))
-		goto failure_handling;
-
-	DRM_DEBUG_KMS("Link Training Passed at Link Rate = %d, Lane count = %d",
-		      intel_dp->link_rate, intel_dp->lane_count);
-	return;
-
- failure_handling:
-	DRM_DEBUG_KMS("Link Training failed at link rate = %d, lane count = %d",
-		      intel_dp->link_rate, intel_dp->lane_count);
-	if (!intel_dp_get_link_train_fallback_values(intel_dp,
-						     intel_dp->link_rate,
-						     intel_dp->lane_count))
-		/* Schedule a Hotplug Uevent to userspace to start modeset */
-		schedule_work(&intel_connector->modeset_retry_work);
-	return;
+	intel_dp_link_training_clock_recovery(intel_dp);
+	intel_dp_link_training_channel_equalization(intel_dp);
 }
drivers/gpu/drm/i915/intel_drv.h +0 -3
index 6c6abc932726..3b797909f631 100644
@@ -316,9 +316,6 @@ struct intel_connector {
 	void *port; /* store this opaque as its illegal to dereference it */
 
 	struct intel_dp *mst_port;
-
-	/* Work struct to schedule a uevent on link train failure */
-	struct work_struct modeset_retry_work;
 };
 
 struct dpll {
Signature · 6 lines
2.11.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Quoted 7 lines

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.

It's possible (I didn't check the logs) this pertains to the failure mode I've sometimes seen, where clock recovery fails, but as we continue with channel equalization anyway (without this patch), everything succeeds there. At worst we need to root cause and fix that issue first. :(

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 19 lines · Jani Nikula
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Quoted 7 lines

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.

Quoted 5 lines

It's possible (I didn't check the logs) this pertains to the failure mode I've sometimes seen, where clock recovery fails, but as we continue with channel equalization anyway (without this patch), everything succeeds there. At worst we need to root cause and fix that issue first. :(

Also, possibly to "avoid noise" in CI, the relevant error messages in intel_dp_link_training_clock_recovery() have been brushed under the carpet by demoting them to DRM_DEBUG_KMS, so we don't really see this happening unless we actually eyeball the logs.

Quoted 3 lines

BR,
Jani.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
In reply to Jani Nikula
Quoted 19 lines · Jani Nikula
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Quoted 7 lines

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.

Quoted 5 lines

It's possible (I didn't check the logs) this pertains to the failure mode I've sometimes seen, where clock recovery fails, but as we continue with channel equalization anyway (without this patch), everything succeeds there. At worst we need to root cause and fix that issue first. :(

The skl case seems pretty clear. We register DP for both port A and port E even though we should register it only for port E (I think). They both end up both using AUX A and so we think the same sink is connected to both, and then we try to enable port A which fail for obvious reasons.

The culprit is init_vbt_defaults() which always sets .supports_dp=true for port A unless later overridden by the VBT. In this case the VBT has no port A, so we leave the .supports_dp flag set. So presumably we should just nuke this stuff from init_vbt_defaults().

IIRC this was discussed at some point between Imre and Paulo, but I can't remember what the conclusion was, or if in fact there was one.

The ilk failure case is a lot less clear. It's one of those cases where the sink just keeps requesting the same vswing/preemph all the time. I've seen it sometime in the past, but I've never been able to figure out what has caused it to happen with any specific sink.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 31 lines · Ville Syrjälä
Quoted 19 lines · Jani Nikula
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Quoted 7 lines

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.

Quoted 5 lines

It's possible (I didn't check the logs) this pertains to the failure mode I've sometimes seen, where clock recovery fails, but as we continue with channel equalization anyway (without this patch), everything succeeds there. At worst we need to root cause and fix that issue first. :(

The skl case seems pretty clear. We register DP for both port A and port E even though we should register it only for port E (I think). They both end up both using AUX A and so we think the same sink is connected to both, and then we try to enable port A which fail for obvious reasons.

Quoted 7 lines

The culprit is init_vbt_defaults() which always sets .supports_dp=true for port A unless later overridden by the VBT. In this case the VBT has no port A, so we leave the .supports_dp flag set. So presumably we should just nuke this stuff from init_vbt_defaults().

IIRC this was discussed at some point between Imre and Paulo, but I can't remember what the conclusion was, or if in fact there was one.

I think one idea was simply

drivers/gpu/drm/i915/intel_bios.c +0 -4
index e144f033f4b5..0261c841756f 100644
@@ -1377,10 +1377,6 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
 			&dev_priv->vbt.ddi_port_info[port];
 
 		info->hdmi_level_shift = HDMI_LEVEL_SHIFT_UNKNOWN;
-
-		info->supports_dvi = (port != PORT_A && port != PORT_E);
-		info->supports_hdmi = info->supports_dvi;
-		info->supports_dp = (port != PORT_E);
 	}
 }
 

---

but apparently it's problematic for machines without VBT, specifically some Chromebooks [citation needed].

Jani.

Quoted 6 lines

The ilk failure case is a lot less clear. It's one of those cases where the sink just keeps requesting the same vswing/preemph all the time. I've seen it sometime in the past, but I've never been able to figure out what has caused it to happen with any specific sink.

Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 59 lines · Jani Nikula
Quoted 31 lines · Ville Syrjälä
Quoted 19 lines · Jani Nikula
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Quoted 7 lines

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.

Quoted 5 lines

It's possible (I didn't check the logs) this pertains to the failure mode I've sometimes seen, where clock recovery fails, but as we continue with channel equalization anyway (without this patch), everything succeeds there. At worst we need to root cause and fix that issue first. :(

The skl case seems pretty clear. We register DP for both port A and port E even though we should register it only for port E (I think). They both end up both using AUX A and so we think the same sink is connected to both, and then we try to enable port A which fail for obvious reasons.

Quoted 7 lines

The culprit is init_vbt_defaults() which always sets .supports_dp=true for port A unless later overridden by the VBT. In this case the VBT has no port A, so we leave the .supports_dp flag set. So presumably we should just nuke this stuff from init_vbt_defaults().

IIRC this was discussed at some point between Imre and Paulo, but I can't remember what the conclusion was, or if in fact there was one.

I think one idea was simply

drivers/gpu/drm/i915/intel_bios.c +0 -5
index e144f033f4b5..0261c841756f 100644
@@ -1377,10 +1377,6 @@ init_vbt_defaults(struct drm_i915_private *dev_priv)
 			&dev_priv->vbt.ddi_port_info[port];
 
 		info->hdmi_level_shift = HDMI_LEVEL_SHIFT_UNKNOWN;
-
-		info->supports_dvi = (port != PORT_A && port != PORT_E);
-		info->supports_hdmi = info->supports_dvi;
-		info->supports_dp = (port != PORT_E);
 	}
 }
 
---
Quoted 2 lines

but apparently it's problematic for machines without VBT, specifically some Chromebooks [citation needed].

I guess the other option would to be split this out and do it only when there's no VBT. Or we could make the VBT parsing code explicitly clear anything not present in the VBT.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw
In reply to Ville Syrjälä
Quoted 36 lines · Ville Syrjälä
Quoted 19 lines · Jani Nikula
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Quoted 7 lines

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.

Quoted 5 lines

It's possible (I didn't check the logs) this pertains to the failure mode I've sometimes seen, where clock recovery fails, but as we continue with channel equalization anyway (without this patch), everything succeeds there. At worst we need to root cause and fix that issue first. :(

The skl case seems pretty clear. We register DP for both port A and port E even though we should register it only for port E (I think). They both end up both using AUX A and so we think the same sink is connected to both, and then we try to enable port A which fail for obvious reasons.

The culprit is init_vbt_defaults() which always sets .supports_dp=true for port A unless later overridden by the VBT. In this case the VBT has no port A, so we leave the .supports_dp flag set. So presumably we should just nuke this stuff from init_vbt_defaults().

Quoted 8 lines

IIRC this was discussed at some point between Imre and Paulo, but I can't remember what the conclusion was, or if in fact there was one.

The ilk failure case is a lot less clear. It's one of those cases where the sink just keeps requesting the same vswing/preemph all the time. I've seen it sometime in the past, but I've never been able to figure out what has caused it to happen with any specific sink.

Looks like starting with:

[    3.621706] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.622794] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.623836] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.624903] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.625983] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1

and so failing to read out EDID. As a result we'll use the default 1024x768 which fails. In the working case we use the native 1920x1200 which succeeds. Could be that 1024x768 didn't work even before?

I can't see how the patch would affect the I2C transfers.

--Imre

Quoted 4 lines
Signature · 3 lines
-- 
Ville Syrjälä
Intel OTC

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw
Quoted 53 lines · Imre Deak
Quoted 36 lines · Ville Syrjälä
Quoted 19 lines · Jani Nikula
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Quoted 7 lines

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.

Quoted 5 lines

It's possible (I didn't check the logs) this pertains to the failure mode I've sometimes seen, where clock recovery fails, but as we continue with channel equalization anyway (without this patch), everything succeeds there. At worst we need to root cause and fix that issue first. :(

The skl case seems pretty clear. We register DP for both port A and port E even though we should register it only for port E (I think). They both end up both using AUX A and so we think the same sink is connected to both, and then we try to enable port A which fail for obvious reasons.

The culprit is init_vbt_defaults() which always sets .supports_dp=true for port A unless later overridden by the VBT. In this case the VBT has no port A, so we leave the .supports_dp flag set. So presumably we should just nuke this stuff from init_vbt_defaults().

Quoted 8 lines

IIRC this was discussed at some point between Imre and Paulo, but I can't remember what the conclusion was, or if in fact there was one.

The ilk failure case is a lot less clear. It's one of those cases where the sink just keeps requesting the same vswing/preemph all the time. I've seen it sometime in the past, but I've never been able to figure out what has caused it to happen with any specific sink.

Looks like starting with:

[    3.621706] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.622794] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.623836] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.624903] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
[    3.625983] [drm:drm_dp_i2c_do_msg] I2C nack (result=0, size=1
Quoted 3 lines

and so failing to read out EDID. As a result we'll use the default 1024x768 which fails. In the working case we use the native 1920x1200 which succeeds. Could be that 1024x768 didn't work even before?

Hm no. The EDID read actually succeeds. The difference in mode is due to a different monitor being attached. In any case I saw the monitor with 1024x768 mode already in earlier logs too where the modeset succeeded, so the problem is somewhere else.

--Imre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw
In reply to Jani Nikula
Quoted 10 lines · Jani Nikula
Quoted 5 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Considering the velocity of drm-tip, I think any CI results for patches have a rather limited best before date. The patch should've been resent and gone through testing again before merging.

Well the original patch also failed in the CI report, so the issue is known even without resubmit.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw
In reply to Chris Wilson
Quoted 10 lines · Chris Wilson
Quoted 4 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

For the record, the failure comes from the error message in intel_dp_get_link_train_fallback_values() as take the fallback path. As userspace is informed, we don't need an *ERROR* at that point.

Should this be just a DEBUG_KMS instead of DRM_ERROR each time it fails link training since we are sending uevent to userspace for it to retry? That will make CI happy, but I think we still need to fix the real problem of eDP link failures on Port A for SKL.

Regards
Manasi

Quoted 11 lines

The really interesting question is why we are seeing link-training failures in CI at all, and whether igt should be checking and reporting link-status=BAD.
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw
In reply to Daniel Vetter
Quoted 8 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Cc Jani Nikula <[email protected]>
Cc Manasi Navare <[email protected]>

Pushed with Manasi' ack on irc.
-Daniel

Quoted 99 lines
---
 drivers/gpu/drm/i915/intel_dp.c               | 27 ---------------------------
 drivers/gpu/drm/i915/intel_dp_link_training.c | 22 ++--------------------
 drivers/gpu/drm/i915/intel_drv.h              |  3 ---
 3 files changed, 2 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -27
index af07a830fa95..d1670b8afbf5 100644
@@ -5790,29 +5790,6 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 	return false;
 }
 
-static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
-{
-	struct intel_connector *intel_connector;
-	struct drm_connector *connector;
-
-	intel_connector = container_of(work, typeof(*intel_connector),
-				       modeset_retry_work);
-	connector = &intel_connector->base;
-	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
-		      connector->name);
-
-	/* Grab the locks before changing connector property*/
-	mutex_lock(&connector->dev->mode_config.mutex);
-	/* Set connector link status to BAD and send a Uevent to notify
-	 * userspace to do a modeset.
-	 */
-	drm_mode_connector_set_link_status_property(connector,
-						    DRM_MODE_LINK_STATUS_BAD);
-	mutex_unlock(&connector->dev->mode_config.mutex);
-	/* Send Hotplug uevent so userspace can reprobe */
-	drm_kms_helper_hotplug_event(connector->dev);
-}
-
 bool
 intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 			struct intel_connector *intel_connector)
@@ -5825,10 +5802,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 	enum port port = intel_dig_port->port;
 	int type;
 
-	/* Initialize the work for modeset in case of link train failure */
-	INIT_WORK(&intel_connector->modeset_retry_work,
-		  intel_dp_modeset_retry_work_fn);
-
 	if (WARN(intel_dig_port->max_lanes < 1,
 		 "Not enough lanes (%d) for DP on port %c\n",
 		 intel_dig_port->max_lanes, port_name(port)))
drivers/gpu/drm/i915/intel_dp_link_training.c +2 -20
index 955b239e7c2d..0048b520baf7 100644
@@ -313,24 +313,6 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp)
 void
 intel_dp_start_link_train(struct intel_dp *intel_dp)
 {
-	struct intel_connector *intel_connector = intel_dp->attached_connector;
-
-	if (!intel_dp_link_training_clock_recovery(intel_dp))
-		goto failure_handling;
-	if (!intel_dp_link_training_channel_equalization(intel_dp))
-		goto failure_handling;
-
-	DRM_DEBUG_KMS("Link Training Passed at Link Rate = %d, Lane count = %d",
-		      intel_dp->link_rate, intel_dp->lane_count);
-	return;
-
- failure_handling:
-	DRM_DEBUG_KMS("Link Training failed at link rate = %d, lane count = %d",
-		      intel_dp->link_rate, intel_dp->lane_count);
-	if (!intel_dp_get_link_train_fallback_values(intel_dp,
-						     intel_dp->link_rate,
-						     intel_dp->lane_count))
-		/* Schedule a Hotplug Uevent to userspace to start modeset */
-		schedule_work(&intel_connector->modeset_retry_work);
-	return;
+	intel_dp_link_training_clock_recovery(intel_dp);
+	intel_dp_link_training_channel_equalization(intel_dp);
 }
drivers/gpu/drm/i915/intel_drv.h +0 -3
index 6c6abc932726..3b797909f631 100644
@@ -316,9 +316,6 @@ struct intel_connector {
 	void *port; /* store this opaque as its illegal to dereference it */
 
 	struct intel_dp *mst_port;
-
-	/* Work struct to schedule a uevent on link train failure */
-	struct work_struct modeset_retry_work;
 };
 
 struct dpll {
Signature · 1 line
2.11.0
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#12 lore raw

Hi Daniel,

I investigated the CI failures because of this patch. These
were essentially the failures which were always there but hidden because they used be DEBUG_KMS messages for link failures so never got caught by CI. But now my patch actually throws DRM_ERROR if the link training fails at RBR and 1 lane. So it caught these errors.

So going back to failures, there were two failures:
1. On SKL 6500 this was because the machine in CI lab is a SKL desktop without eDP on Port A. But our VBT initialization code in the driver writes VBT defaults in a way that it always sets DP flag on Port A and this does not get cleared after parsing the VBT outputs. So now there is a fix for this by Jani Nikula in the driver which is merged. "drm/i915/vbt: defaults handling for no VBT case"

2. On ILK desktop - This was happening because of a bad monitor desktop combination. I switched the monitor in the CI lab and that helped get rid of the link failures on ILK system.

So now looks like the fixes have gone in to fix the link failures thrown by this patch. Should I resend this patch now?

Regards
Manasi

Quoted 108 lines · Daniel Vetter
Quoted 8 lines · Daniel Vetter

This reverts commit 233ce881dd91fb13eb6b09deefae33168e6ead4c.

I assumed it's ok, but really should have double-checked - CI caught tons of fail :(

Cc Jani Nikula <[email protected]>
Cc Manasi Navare <[email protected]>

Pushed with Manasi' ack on irc.
-Daniel

Quoted 95 lines
---
 drivers/gpu/drm/i915/intel_dp.c               | 27 ---------------------------
 drivers/gpu/drm/i915/intel_dp_link_training.c | 22 ++--------------------
 drivers/gpu/drm/i915/intel_drv.h              |  3 ---
 3 files changed, 2 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -27
index af07a830fa95..d1670b8afbf5 100644
@@ -5790,29 +5790,6 @@ static bool intel_edp_init_connector(struct intel_dp *intel_dp,
 	return false;
 }
 
-static void intel_dp_modeset_retry_work_fn(struct work_struct *work)
-{
-	struct intel_connector *intel_connector;
-	struct drm_connector *connector;
-
-	intel_connector = container_of(work, typeof(*intel_connector),
-				       modeset_retry_work);
-	connector = &intel_connector->base;
-	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id,
-		      connector->name);
-
-	/* Grab the locks before changing connector property*/
-	mutex_lock(&connector->dev->mode_config.mutex);
-	/* Set connector link status to BAD and send a Uevent to notify
-	 * userspace to do a modeset.
-	 */
-	drm_mode_connector_set_link_status_property(connector,
-						    DRM_MODE_LINK_STATUS_BAD);
-	mutex_unlock(&connector->dev->mode_config.mutex);
-	/* Send Hotplug uevent so userspace can reprobe */
-	drm_kms_helper_hotplug_event(connector->dev);
-}
-
 bool
 intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 			struct intel_connector *intel_connector)
@@ -5825,10 +5802,6 @@ intel_dp_init_connector(struct intel_digital_port *intel_dig_port,
 	enum port port = intel_dig_port->port;
 	int type;
 
-	/* Initialize the work for modeset in case of link train failure */
-	INIT_WORK(&intel_connector->modeset_retry_work,
-		  intel_dp_modeset_retry_work_fn);
-
 	if (WARN(intel_dig_port->max_lanes < 1,
 		 "Not enough lanes (%d) for DP on port %c\n",
 		 intel_dig_port->max_lanes, port_name(port)))
drivers/gpu/drm/i915/intel_dp_link_training.c +2 -20
index 955b239e7c2d..0048b520baf7 100644
@@ -313,24 +313,6 @@ void intel_dp_stop_link_train(struct intel_dp *intel_dp)
 void
 intel_dp_start_link_train(struct intel_dp *intel_dp)
 {
-	struct intel_connector *intel_connector = intel_dp->attached_connector;
-
-	if (!intel_dp_link_training_clock_recovery(intel_dp))
-		goto failure_handling;
-	if (!intel_dp_link_training_channel_equalization(intel_dp))
-		goto failure_handling;
-
-	DRM_DEBUG_KMS("Link Training Passed at Link Rate = %d, Lane count = %d",
-		      intel_dp->link_rate, intel_dp->lane_count);
-	return;
-
- failure_handling:
-	DRM_DEBUG_KMS("Link Training failed at link rate = %d, lane count = %d",
-		      intel_dp->link_rate, intel_dp->lane_count);
-	if (!intel_dp_get_link_train_fallback_values(intel_dp,
-						     intel_dp->link_rate,
-						     intel_dp->lane_count))
-		/* Schedule a Hotplug Uevent to userspace to start modeset */
-		schedule_work(&intel_connector->modeset_retry_work);
-	return;
+	intel_dp_link_training_clock_recovery(intel_dp);
+	intel_dp_link_training_channel_equalization(intel_dp);
 }
drivers/gpu/drm/i915/intel_drv.h +0 -3
index 6c6abc932726..3b797909f631 100644
@@ -316,9 +316,6 @@ struct intel_connector {
 	void *port; /* store this opaque as its illegal to dereference it */
 
 	struct intel_dp *mst_port;
-
-	/* Work struct to schedule a uevent on link train failure */
-	struct work_struct modeset_retry_work;
 };
 
Quoted 9 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_drv.h +0 -0
 struct dpll {
Signature · 1 line
2.11.0
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx