Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Lespiau <damien.lespiau@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Double check ring is idle before declaring the GPU wedged
Date: Mon, 11 Aug 2014 10:30:09 +0100	[thread overview]
Message-ID: <20140811093009.GA15201@strange.ger.corp.intel.com> (raw)
In-Reply-To: <1407745295-13830-1-git-send-email-chris@chris-wilson.co.uk>

On Mon, Aug 11, 2014 at 09:21:35AM +0100, Chris Wilson wrote:
> During ring initialisation, sometimes we observe, though not in
> production hardware, that the idle flag is not set even though the ring
> is empty. Double check before giving up.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index a0831c309eab..d72d5e0e693d 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -467,7 +467,12 @@ static bool stop_ring(struct intel_engine_cs *ring)
>  		I915_WRITE_MODE(ring, _MASKED_BIT_ENABLE(STOP_RING));
>  		if (wait_for((I915_READ_MODE(ring) & MODE_IDLE) != 0, 1000)) {
>  			DRM_ERROR("%s : timed out trying to stop ring\n", ring->name);
> -			return false;
> +			/* Sometimes we observe that the idle flag is not
> +			 * set even though the ring is empty. So double
> +			 * check before giving up.
> +			 */
> +			if (I915_READ_HEAD(ring) != I915_READ_TAIL(ring))
> +				return false;

That means we propably want to just put the user visible error message
there as well?

-- 
Damien

  reply	other threads:[~2014-08-11  9:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11  8:21 [PATCH] drm/i915: Double check ring is idle before declaring the GPU wedged Chris Wilson
2014-08-11  9:30 ` Damien Lespiau [this message]
2014-08-11  9:35   ` Chris Wilson
2014-08-11 10:07     ` Damien Lespiau
2014-08-11 10:14       ` Chris Wilson
2014-08-11 11:34       ` Daniel Vetter

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=20140811093009.GA15201@strange.ger.corp.intel.com \
    --to=damien.lespiau@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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