Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: make sink_crc return -EIO on aux read/write failure
Date: Thu, 2 Oct 2014 09:49:43 +0200	[thread overview]
Message-ID: <20141002074943.GT12343@phenom.ffwll.local> (raw)
In-Reply-To: <1412173957-13553-1-git-send-email-rodrigo.vivi@intel.com>

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 <daniel.vetter@ffwll.ch>
> Cc: Todd Previte <tprevite@gmail.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

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

      reply	other threads:[~2014-10-02  7:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01 14:32 [PATCH] drm/i915: make sink_crc return -EIO on aux read/write failure Rodrigo Vivi
2014-10-02  7:49 ` Daniel Vetter [this message]

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=20141002074943.GT12343@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox