From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm: aux ->transfer() can return 0, deal with it Date: Thu, 28 Jul 2016 18:37:28 +0200 Message-ID: <20160728163728.GQ6232@phenom.ffwll.local> References: <1469717682-12903-1-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <1469717682-12903-1-git-send-email-ville.syrjala@linux.intel.com> Sender: stable-owner@vger.kernel.org To: ville.syrjala@linux.intel.com, Dave Airlie Cc: dri-devel@lists.freedesktop.org, Lyude , Daniel Vetter , stable@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org On Thu, Jul 28, 2016 at 05:54:42PM +0300, ville.syrjala@linux.intel.com= wrote: > From: Ville Syrj=E4l=E4 >=20 > Restore the correct behaviour (as in check msg.reply) when aux > ->transfer() returns 0. It got removed in > commit 82922da39190 ("drm/dp_helper: Retry aux transactions on all er= rors") >=20 > Now I can actually dump the "entire" DPCD on a Dell UP2314Q with > ddrescue. It has some offsets in the DPCD that can't be read > for some resaon, all you get is defers. Previously ddrescue would > just give up at the first unredable offset on account of > read() returning 0 means EOF. Here's the ddrescue log > for the interested: > 0x00000000 0x00001400 + > 0x00001400 0x00000030 - > 0x00001430 0x000001D0 + > 0x00001600 0x00000030 - > 0x00001630 0x0001F9D0 + > 0x00021000 0x00000001 - > 0x00021001 0x000DEFFF + >=20 > Cc: Lyude > Cc: Daniel Vetter Cc: stable@vger.kernel.org > Fixes: 82922da39190 ("drm/dp_helper: Retry aux transactions on all er= rors") > Signed-off-by: Ville Syrj=E4l=E4 Seems to correctly restore that special case. Reviewed-by: Daniel Vetter Dave, since I just send out a drm-misc pull, can you pls apply this one directly to drm-next? -Daniel > --- > drivers/gpu/drm/drm_dp_helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp= _helper.c > index 091053e995e5..8f11b8741e42 100644 > --- a/drivers/gpu/drm/drm_dp_helper.c > +++ b/drivers/gpu/drm/drm_dp_helper.c > @@ -203,7 +203,7 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *= aux, u8 request, > =20 > ret =3D aux->transfer(aux, &msg); > =20 > - if (ret > 0) { > + if (ret >=3D 0) { > native_reply =3D msg.reply & DP_AUX_NATIVE_REPLY_MASK; > if (native_reply =3D=3D DP_AUX_NATIVE_REPLY_ACK) { > if (ret =3D=3D size) > --=20 > 2.7.4 >=20 --=20 Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch