Skip to contentSkip to conversation

drm/i915: don't disable the DP port if the link is lost

PATCH In review Imre Deak 3 participants 10 messages Jan 16, 2014 – Jan 17, 2014

Subsystems (2)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/2 drm/i915: don't disable the DP port if the link is lost

Currently if the DP link is lost (either because of a hot unplug, or failed link status check) we disable the DP port, but leave the rest of the pipe running. This is incompatible with the modeset disabling sequence of some platforms/configurations. At least this is the case for DP ports on the CPU as opposed to PCH.

Atm we'll also get a warning when we do a modeset disable after the above link lost event, since we expect the DP port to be enabled at this point (see the bugzilla ticket for the related dmesg).

Note that with this patch we'll still end up disabling the port, thanks to the HPD uevent and subsequent modeset disable.

See also the next patch fixing the other half of this issue.

Solution suggested by Ville.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70570

unload

---
 drivers/gpu/drm/i915/intel_dp.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/intel_dp.c +0 -2
index e265488..0c62035 100644
@@ -2891,13 +2891,11 @@ intel_dp_check_link_status(struct intel_dp *intel_dp)
 
 	/* Try to read receiver status if the link appears to be up */
 	if (!intel_dp_get_link_status(intel_dp, link_status)) {
-		intel_dp_link_down(intel_dp);
 		return;
 	}
 
 	/* Now read the DPCD to see if it's actually running */
 	if (!intel_dp_get_dpcd(intel_dp)) {
-		intel_dp_link_down(intel_dp);
 		return;
 	}
 
Signature · 1 line
1.8.4
author
#1 lore raw

PATCH 2/2 drm/i915: don't disable DP port after a failed link training

The driver shouldn't disable the DP port itself, but let userspace do it through a modeset. See the previous patch for the reasoning.

Keeping this as a separate patch for bisectability.

---
 drivers/gpu/drm/i915/intel_dp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +0 -1
index 0c62035..d3371f5 100644
@@ -2638,7 +2638,6 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
 
 		if (cr_tries > 5) {
 			DRM_ERROR("failed to train DP, aborting\n");
-			intel_dp_link_down(intel_dp);
 			break;
 		}
 
Signature · 1 line
1.8.4
#2 lore raw

Re: [PATCH 2/2] drm/i915: don't disable DP port after a failed link training

Quoted 2 lines · Imre Deak

The driver shouldn't disable the DP port itself, but let userspace do it through a modeset. See the previous patch for the reasoning.

Eh, this occurs not just during link detection, but also during intel_enable_dp, so this comment does not hold. The biggest issue of this function is that it can fail but never propagates that failure, which itself breaks the users and API expectations, as neither the driver or userspace is aware that it is required to takeaction.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#3 lore raw

Re: [PATCH 2/2] drm/i915: don't disable DP port after a failed link training

Quoted 10 lines · Chris Wilson
Quoted 2 lines · Imre Deak

The driver shouldn't disable the DP port itself, but let userspace do it through a modeset. See the previous patch for the reasoning.

Eh, this occurs not just during link detection, but also during intel_enable_dp, so this comment does not hold. The biggest issue of this function is that it can fail but never propagates that failure, which itself breaks the users and API expectations, as neither the driver or userspace is aware that it is required to takeaction.

Yeah, but imo that's a separate issue - atm we kill the DP port, which stops the pipe, which is something our code never expects. Resulting in piles of funny bug reports from angry users who's machine got stuck because of this.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw

Re: [PATCH 2/2] drm/i915: don't disable DP port after a failed link training

Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Chris Wilson
Quoted 2 lines · Imre Deak

The driver shouldn't disable the DP port itself, but let userspace do it through a modeset. See the previous patch for the reasoning.

Eh, this occurs not just during link detection, but also during intel_enable_dp, so this comment does not hold. The biggest issue of this function is that it can fail but never propagates that failure, which itself breaks the users and API expectations, as neither the driver or userspace is aware that it is required to takeaction.

Quoted 4 lines

Yeah, but imo that's a separate issue - atm we kill the DP port, which stops the pipe, which is something our code never expects. Resulting in piles of funny bug reports from angry users who's machine got stuck because of this.

But this alone will not stop the bug reports - the display will still be blank but kernel/userspace will continue to believe that the modeset took place.

I did not say that the patch was not sensible, just insufficient ;-) -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#5 lore raw

Re: [PATCH 2/2] drm/i915: don't disable DP port after a failed link training

Quoted 18 lines · Chris Wilson
Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Chris Wilson
Quoted 2 lines · Imre Deak

The driver shouldn't disable the DP port itself, but let userspace do it through a modeset. See the previous patch for the reasoning.

Eh, this occurs not just during link detection, but also during intel_enable_dp, so this comment does not hold. The biggest issue of this function is that it can fail but never propagates that failure, which itself breaks the users and API expectations, as neither the driver or userspace is aware that it is required to takeaction.

Quoted 4 lines

Yeah, but imo that's a separate issue - atm we kill the DP port, which stops the pipe, which is something our code never expects. Resulting in piles of funny bug reports from angry users who's machine got stuck because of this.

Quoted 5 lines

But this alone will not stop the bug reports - the display will still be blank but kernel/userspace will continue to believe that the modeset took place.

I did not say that the patch was not sensible, just insufficient ;-)

Well if we're lucky the next modeset works, or the 2nd display still works, or at least X isn't stuck and maybe apps can still autosave. I agree it's not the full solution, but it should be quite a bit better than what we currently do ;-)

The other issue is that atm I don't have a good idea for how we could wire this up correctly. In a way for all other outputs we don't tell userspace that stuff went wrong either ...
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
author
#6 lore raw

Re: [PATCH 2/2] drm/i915: don't disable DP port after a failed link training

In reply to Chris Wilson
Quoted 10 lines · Chris Wilson
Quoted 2 lines · Imre Deak

The driver shouldn't disable the DP port itself, but let userspace do it through a modeset. See the previous patch for the reasoning.

Eh, this occurs not just during link detection, but also during intel_enable_dp, so this comment does not hold. The biggest issue of this function is that it can fail but never propagates that failure, which itself breaks the users and API expectations, as neither the driver or userspace is aware that it is required to takeaction.

Right, I haven't thought about this and the commit message is incorrect. So in the end with proper error handling it's gonna be the kernel that disables the port along with the rest of the pipe.

I agree with danvet, that we could still have this before a final solution. (with a fixed commit message).

--Imre

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

author
#7 lore raw

PATCH 1/1 drm/i915: don't disable DP port after a failed link training

In reply to Imre Deak

Atm after a failed link training we disable the DP port. This can happen during a modeset-enable or a DP link re-establishment. The latter can be a problem and we shouldn't disable the DP port, see the previous patch for the reasoning. In the former case the right thing would be to disable the DP port, but also the rest of the pipe.

As a stop-gap solution leave the DP port enabled in both cases. It is an improvement on its own (avoiding HW lock ups) and the proper solution for the first case requires a bigger change, so let's keep that on the TODO list.

v2:
- fix explanation of change impact (Chris)

---
 drivers/gpu/drm/i915/intel_dp.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/intel_dp.c +0 -1
index 7b630e9..689b832 100644
@@ -2638,7 +2638,6 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
 
 		if (cr_tries > 5) {
 			DRM_ERROR("failed to train DP, aborting\n");
-			intel_dp_link_down(intel_dp);
 			break;
 		}
 
Signature · 1 line
1.8.4
Reviewed-by on v1 1/1
#8 lore raw

Re: [PATCH] drm/i915: don't disable DP port after a failed link training

Quoted 11 lines · Imre Deak

Atm after a failed link training we disable the DP port. This can happen during a modeset-enable or a DP link re-establishment. The latter can be a problem and we shouldn't disable the DP port, see the previous patch for the reasoning. In the former case the right thing would be to disable the DP port, but also the rest of the pipe.

As a stop-gap solution leave the DP port enabled in both cases. It is an improvement on its own (avoiding HW lock ups) and the proper solution for the first case requires a bigger change, so let's keep that on the TODO list.

Quoted 5 lines

v2:
- fix explanation of change impact (Chris)

and r-b for patch 1 as well (if I didn't send it). -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#9 lore raw

Re: [PATCH] drm/i915: don't disable DP port after a failed link training

Quoted 12 lines · Chris Wilson
Quoted 11 lines · Imre Deak

Atm after a failed link training we disable the DP port. This can happen during a modeset-enable or a DP link re-establishment. The latter can be a problem and we shouldn't disable the DP port, see the previous patch for the reasoning. In the former case the right thing would be to disable the DP port, but also the rest of the pipe.

As a stop-gap solution leave the DP port enabled in both cases. It is an improvement on its own (avoiding HW lock ups) and the proper solution for the first case requires a bigger change, so let's keep that on the TODO list.

Quoted 7 lines
Quoted 5 lines

v2:
- fix explanation of change impact (Chris)

and r-b for patch 1 as well (if I didn't send it).

Both merged, thanks.
-Daniel

Quoted 8 lines

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch