From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: make sink_crc return -EIO on aux read/write failure Date: Thu, 2 Oct 2014 09:49:43 +0200 Message-ID: <20141002074943.GT12343@phenom.ffwll.local> References: <1412173957-13553-1-git-send-email-rodrigo.vivi@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by gabe.freedesktop.org (Postfix) with ESMTP id B7F5B6E00E for ; Thu, 2 Oct 2014 00:49:47 -0700 (PDT) Received: by mail-wg0-f51.google.com with SMTP id b13so2366160wgh.22 for ; Thu, 02 Oct 2014 00:49:46 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1412173957-13553-1-git-send-email-rodrigo.vivi@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Rodrigo Vivi Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Oct 01, 2014 at 07:32:37AM -0700, Rodrigo Vivi wrote: Nothing is usually to little commit message. I've fixed this while applying. > Cc: Daniel Vetter > Cc: Todd Previte > Signed-off-by: Rodrigo Vivi Queued for -next, thanks for the patch. -Daniel > --- > drivers/gpu/drm/i915/intel_dp.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index ad4eb6d..8ead695 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -3868,16 +3868,21 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc) > if (!(buf & DP_TEST_CRC_SUPPORTED)) > return -ENOTTY; > > - drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf); > + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) > + return -EIO; > + > if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK, > buf | DP_TEST_SINK_START) < 0) > return -EIO; > > - drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf); > + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0) > + return -EIO; > test_crc_count = buf & DP_TEST_COUNT_MASK; > > do { > - drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf); > + if (drm_dp_dpcd_readb(&intel_dp->aux, > + DP_TEST_SINK_MISC, &buf) < 0) > + return -EIO; > intel_wait_for_vblank(dev, intel_crtc->pipe); > } while (--attempts && (buf & DP_TEST_COUNT_MASK) == test_crc_count); > > @@ -3889,9 +3894,11 @@ int intel_dp_sink_crc(struct intel_dp *intel_dp, u8 *crc) > if (drm_dp_dpcd_read(&intel_dp->aux, DP_TEST_CRC_R_CR, crc, 6) < 0) > return -EIO; > > - drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf); > - drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK, > - buf & ~DP_TEST_SINK_START); > + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) > + return -EIO; > + if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK, > + buf & ~DP_TEST_SINK_START) < 0) > + return -EIO; > > return 0; > } > -- > 1.9.3 > -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch