From mboxrd@z Thu Jan 1 00:00:00 1970 From: Todd Previte Subject: Re: [PATCH 2/4] drm/i915/dp: increase i2c-over-aux retry interval on AUX DEFER Date: Fri, 20 Sep 2013 13:56:20 -0700 Message-ID: <523CB674.90006@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1903074871==" Return-path: Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by gabe.freedesktop.org (Postfix) with ESMTP id D8B43E63AB for ; Fri, 20 Sep 2013 13:56:23 -0700 (PDT) Received: by mail-pd0-f170.google.com with SMTP id x10so842922pdj.1 for ; Fri, 20 Sep 2013 13:56:23 -0700 (PDT) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============1903074871== Content-Type: multipart/alternative; boundary="------------020708060509020305050708" This is a multi-part message in MIME format. --------------020708060509020305050708 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 09/20/2013 06:42 AM, Jani Nikula wrote: > There is no clear cut rules or specs for the retry interval, as there > are many factors that affect overall response time. Increase the > interval, and even more so on branch devices which may have limited i2c > bit rates. > > Signed-off-by: Jani Nikula > --- > drivers/gpu/drm/i915/intel_dp.c | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index 6626514..3afbea9 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -678,7 +678,18 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode, > DRM_DEBUG_KMS("aux_ch native nack\n"); > return -EREMOTEIO; > case AUX_NATIVE_REPLY_DEFER: > - udelay(100); > + /* > + * For now, just give more slack to branch devices. We > + * could check the DPCD for I2C bit rate capabilities, > + * and if available, adjust the interval. We could also > + * be more careful with DP-to-Legacy adapters where a > + * long legacy cable may force very low I2C bit rates. > + */ > + if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] & > + DP_DWN_STRM_PORT_PRESENT) > + usleep_range(500, 600); > + else > + usleep_range(300, 400); > continue; > default: > DRM_ERROR("aux_ch invalid native reply 0x%02x\n", Those look like reasonable values to me. [Reviewed-by]: Todd Previte > --------------020708060509020305050708 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
On 09/20/2013 06:42 AM, Jani Nikula wrote:
There is no clear cut rules or specs for the retry interval, as there
are many factors that affect overall response time. Increase the
interval, and even more so on branch devices which may have limited i2c
bit rates.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 6626514..3afbea9 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -678,7 +678,18 @@ intel_dp_i2c_aux_ch(struct i2c_adapter *adapter, int mode,
 			DRM_DEBUG_KMS("aux_ch native nack\n");
 			return -EREMOTEIO;
 		case AUX_NATIVE_REPLY_DEFER:
-			udelay(100);
+			/*
+			 * For now, just give more slack to branch devices. We
+			 * could check the DPCD for I2C bit rate capabilities,
+			 * and if available, adjust the interval. We could also
+			 * be more careful with DP-to-Legacy adapters where a
+			 * long legacy cable may force very low I2C bit rates.
+			 */
+			if (intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
+			    DP_DWN_STRM_PORT_PRESENT)
+				usleep_range(500, 600);
+			else
+				usleep_range(300, 400);
 			continue;
 		default:
 			DRM_ERROR("aux_ch invalid native reply 0x%02x\n",

Those look like reasonable values to me.

[Reviewed-by]: Todd Previte <tprevite@gmail.com> --------------020708060509020305050708-- --===============1903074871== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1903074871==--