From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Packard Subject: Re: [PATCH 1/8] drm/i915/dp: retry link status read 3 times on failure Date: Fri, 01 Jul 2011 16:41:06 -0700 Message-ID: References: <1309558978-4704-1-git-send-email-jbarnes@virtuousgeek.org> <1309558978-4704-2-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0711582641==" Return-path: Received: from keithp.com (home.keithp.com [63.227.221.253]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DC989E744 for ; Fri, 1 Jul 2011 16:41:10 -0700 (PDT) In-Reply-To: <1309558978-4704-2-git-send-email-jbarnes@virtuousgeek.org> 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: Jesse Barnes , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============0711582641== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" --=-=-= Content-Transfer-Encoding: quoted-printable On Fri, 1 Jul 2011 15:22:51 -0700, Jesse Barnes = wrote: > 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. There's no 'false' return path here. I think you want: >=20 > --- > drivers/gpu/drm/i915/intel_dp.c | 17 +++++++++++++---- > 1 files changed, 13 insertions(+), 4 deletions(-) >=20 > 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 mo= de) > 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 =3D 0; i < 3; i++) { > + ret =3D intel_dp_aux_native_read(intel_dp, > + DP_LANE0_1_STATUS, > + intel_dp->link_status, > + DP_LINK_STATUS_SIZE); > + if (ret =3D=3D DP_LINK_STATUS_SIZE) > + break; return true; > + msleep(1); > + } >=20=20 > - ret =3D intel_dp_aux_native_read(intel_dp, > - DP_LANE0_1_STATUS, > - intel_dp->link_status, DP_LINK_STATUS_SIZE); > if (ret !=3D DP_LINK_STATUS_SIZE) > return false; > + > return true; return false; =20=20=20=20=20=20=20=20 > } =2D-=20 keith.packard@intel.com --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iD8DBQFODlsTQp8BWwlsTdMRAoqoAKDEflFJ+f6vn/HLy1LOsCWdgMWd+wCfZIAt cszQQziuEkotIgurxKSzqvA= =paZ1 -----END PGP SIGNATURE----- --=-=-=-- --===============0711582641== 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 --===============0711582641==--