diff mbox

[v2,2/2] drm/i915/dp: Dump DP link status when link training stages fail

Message ID 1470343716-5574-3-git-send-email-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dhinakaran Pandiyan Aug. 4, 2016, 8:48 p.m. UTC
A full dump of link status can be handy in debugging link training
failures. Let's add that to the debug messages when link training fails.

v2: Removing unrelated clean up (Jani)
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 drivers/gpu/drm/i915/intel_dp_link_training.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Chris Wilson Aug. 5, 2016, 9:35 a.m. UTC | #1
On Thu, Aug 04, 2016 at 01:48:36PM -0700, Dhinakaran Pandiyan wrote:
> A full dump of link status can be handy in debugging link training
> failures. Let's add that to the debug messages when link training fails.
> 
> v2: Removing unrelated clean up (Jani)
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Dhinakaran Pandiyan Aug. 5, 2016, 5:08 p.m. UTC | #2
On Fri, 2016-08-05 at 10:35 +0100, Chris Wilson wrote:
> On Thu, Aug 04, 2016 at 01:48:36PM -0700, Dhinakaran Pandiyan wrote:

> > A full dump of link status can be handy in debugging link training

> > failures. Let's add that to the debug messages when link training fails.

> > 

> > v2: Removing unrelated clean up (Jani)

> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>

> -Chris

> 

Thanks Chris!
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c
index 60fb39c..0deebed 100644
--- a/drivers/gpu/drm/i915/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/intel_dp_link_training.c
@@ -24,6 +24,15 @@ 
 #include "intel_drv.h"
 
 static void
+intel_dp_dump_link_status(const uint8_t link_status[DP_LINK_STATUS_SIZE])
+{
+
+	DRM_DEBUG_KMS("ln0_1:0x%x ln2_3:0x%x align:0x%x sink:0x%x adj_req0_1:0x%x adj_req2_3:0x%x",
+		      link_status[0], link_status[1], link_status[2],
+		      link_status[3], link_status[4], link_status[5]);
+}
+
+static void
 intel_get_adjust_train(struct intel_dp *intel_dp,
 		       const uint8_t link_status[DP_LINK_STATUS_SIZE])
 {
@@ -168,6 +177,7 @@  intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp)
 			++loop_tries;
 			if (loop_tries == 5) {
 				DRM_ERROR("too many full retries, give up\n");
+				intel_dp_dump_link_status(link_status);
 				break;
 			}
 			intel_dp_reset_link_train(intel_dp,
@@ -254,6 +264,7 @@  intel_dp_link_training_channel_equalization(struct intel_dp *intel_dp)
 
 		if (cr_tries > 5) {
 			DRM_ERROR("failed to train DP, aborting\n");
+			intel_dp_dump_link_status(link_status);
 			break;
 		}