All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 1/8] drm/i915/dp: retry link status read 3 times on failure
Date: Fri,  1 Jul 2011 15:22:51 -0700	[thread overview]
Message-ID: <1309558978-4704-2-git-send-email-jbarnes@virtuousgeek.org> (raw)
In-Reply-To: <1309558978-4704-1-git-send-email-jbarnes@virtuousgeek.org>

Especially after a hotplug or power status change, the sink may not
reply immediately to a link status query.  So retry 3 times per the spec
to really make sure nothing is there.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_dp.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 391b55f..1829ecc 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1019,13 +1019,22 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode)
 static bool
 intel_dp_get_link_status(struct intel_dp *intel_dp)
 {
-	int ret;
+	int ret, i;
+
+	/* Must try AUX reads for this at least 3 times */
+	for (i = 0; i < 3; i++) {
+		ret = intel_dp_aux_native_read(intel_dp,
+					       DP_LANE0_1_STATUS,
+					       intel_dp->link_status,
+					       DP_LINK_STATUS_SIZE);
+		if (ret == DP_LINK_STATUS_SIZE)
+			break;
+		msleep(1);
+	}
 
-	ret = intel_dp_aux_native_read(intel_dp,
-				       DP_LANE0_1_STATUS,
-				       intel_dp->link_status, DP_LINK_STATUS_SIZE);
 	if (ret != DP_LINK_STATUS_SIZE)
 		return false;
+
 	return true;
 }
 
-- 
1.7.4.1

  reply	other threads:[~2011-07-01 22:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 22:22 [RFC] misc DP fixes/changes Jesse Barnes
2011-07-01 22:22 ` Jesse Barnes [this message]
2011-07-01 23:41   ` [PATCH 1/8] drm/i915/dp: retry link status read 3 times on failure Keith Packard
2011-07-01 23:47     ` Jesse Barnes
2011-07-06  4:27   ` Eric Anholt
2011-07-06 16:09     ` Jesse Barnes
2011-07-01 22:22 ` [PATCH 2/8] drm/i915/dp: use DP DPCD defines when looking at DPCD values Jesse Barnes
2011-07-01 23:43   ` Keith Packard
2011-07-01 22:22 ` [PATCH 3/8] drm/i915/dp: read more receiver capability bits on hotplug Jesse Barnes
2011-07-01 23:45   ` Keith Packard
2011-07-01 22:22 ` [PATCH 4/8] drm/i915/dp: try to read receiver capabilities 3 times when detecting Jesse Barnes
2011-07-01 23:45   ` Keith Packard
2011-07-01 22:22 ` [PATCH 5/8] drm/i915/dp: set DP DPMS mode to "on" in ->commit Jesse Barnes
2011-07-01 23:46   ` Keith Packard
2011-07-01 22:22 ` [PATCH 6/8] drm/i915/dp: clear DP encoder CRTC if the receiver disappears Jesse Barnes
2011-07-01 23:48   ` Keith Packard
2011-07-01 23:59     ` Jesse Barnes
2011-07-02  0:31       ` Keith Packard
2011-07-01 22:22 ` [PATCH 7/8] drm/i915/dp: rename dpms_mode to receiver_configured Jesse Barnes
2011-07-01 23:50   ` Keith Packard
2011-07-01 22:22 ` [PATCH 8/8] drm/i915/dp: clear receiver_configured when link training fails Jesse Barnes
2011-07-01 23:51   ` Keith Packard
2011-07-01 23:39 ` [RFC] misc DP fixes/changes Keith Packard

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=1309558978-4704-2-git-send-email-jbarnes@virtuousgeek.org \
    --to=jbarnes@virtuousgeek.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.