Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 05/13] drm/i915: introduce i915_hangcheck_ring_hung
Date: Tue, 26 Feb 2013 15:03:38 -0800	[thread overview]
Message-ID: <20130226230337.GC3759@bwidawsk.net> (raw)
In-Reply-To: <1361876716-8625-6-git-send-email-mika.kuoppala@intel.com>

On Tue, Feb 26, 2013 at 01:05:08PM +0200, Mika Kuoppala wrote:
> In preparation to track per ring progress in hangcheck,
> add i915_hangcheck_ring_hung.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c |   31 +++++++++++++++++++------------
>  1 file changed, 19 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index de5af12..b828807 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -1771,28 +1771,35 @@ static bool kick_ring(struct intel_ring_buffer *ring)
>  	return false;
>  }
>  
> +static bool i915_hangcheck_ring_hung(struct drm_device *dev,
> +				     struct intel_ring_buffer *ring)
> +{
> +	if (!IS_GEN2(dev)) {
> +		/* Is the chip hanging on a WAIT_FOR_EVENT?
> +		 * If so we can simply poke the RB_WAIT bit
> +		 * and break the hang. This should work on
> +		 * all but the second generation chipsets.
> +		 */
> +		return !kick_ring(ring);
> +	}
> +
> +	return false;
> +}
> +
>  static bool i915_hangcheck_hung(struct drm_device *dev)
>  {
>  	drm_i915_private_t *dev_priv = dev->dev_private;
>  
>  	if (dev_priv->gpu_error.hangcheck_count++ > 1) {
>  		bool hung = true;
> +		struct intel_ring_buffer *ring;
> +		int i;
>  
>  		DRM_ERROR("Hangcheck timer elapsed... GPU hung\n");
>  		i915_handle_error(dev, true);
>  
> -		if (!IS_GEN2(dev)) {
> -			struct intel_ring_buffer *ring;
> -			int i;
> -
> -			/* Is the chip hanging on a WAIT_FOR_EVENT?
> -			 * If so we can simply poke the RB_WAIT bit
> -			 * and break the hang. This should work on
> -			 * all but the second generation chipsets.
> -			 */
> -			for_each_ring(ring, dev_priv, i)
> -				hung &= !kick_ring(ring);
> -		}
> +		for_each_ring(ring, dev_priv, i)
> +			hung &= i915_hangcheck_ring_hung(dev, ring);
>  
>  		return hung;
>  	}

I don't think you need dev. Just bail early if it's GEN2. If you really
need dev later, you can get it from ring->dev.

-- 
Ben Widawsky, Intel Open Source Technology Center

  reply	other threads:[~2013-02-26 23:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26 11:05 [PATCH 00/13] arb robustness enablers Mika Kuoppala
2013-02-26 11:05 ` [PATCH 01/13] drm/i915: add context parameter to i915_switch_context() Mika Kuoppala
2013-02-26 18:31   ` Ben Widawsky
2013-02-26 11:05 ` [PATCH 02/13] drm/i915: reference count for i915_hw_contexts Mika Kuoppala
2013-02-26 21:45   ` Ben Widawsky
2013-02-26 11:05 ` [PATCH 03/13] drm/i915: pass seqno to i915_hangcheck_ring_idle Mika Kuoppala
2013-02-26 22:41   ` Ben Widawsky
2013-03-01 13:49     ` Mika Kuoppala
2013-02-26 11:05 ` [PATCH 04/13] drm/i915: track ring progression using seqnos Mika Kuoppala
2013-02-26 14:12   ` Chris Wilson
2013-02-26 15:09     ` Mika Kuoppala
2013-02-26 15:31       ` Chris Wilson
2013-02-26 11:05 ` [PATCH 05/13] drm/i915: introduce i915_hangcheck_ring_hung Mika Kuoppala
2013-02-26 23:03   ` Ben Widawsky [this message]
2013-02-26 11:05 ` [PATCH 06/13] drm/i915: detect hang using per ring hangcheck_score Mika Kuoppala
2013-02-26 14:16   ` Chris Wilson
2013-02-26 11:05 ` [PATCH 07/13] drm/i915: remove i915_hangcheck_hung Mika Kuoppala
2013-02-26 11:05 ` [PATCH 08/13] drm/i915: add struct ctx_reset_state Mika Kuoppala
2013-02-26 11:05 ` [PATCH 09/13] drm/i915: add reset_state for hw_contexts Mika Kuoppala
2013-02-27  1:47   ` Ian Romanick
2013-02-27  1:50     ` Ian Romanick
2013-02-27  9:13     ` Chris Wilson
2013-02-28  1:15       ` Ian Romanick
2013-02-28 11:14         ` Chris Wilson
2013-02-28 20:31           ` Ian Romanick
2013-02-27 10:11     ` Mika Kuoppala
2013-02-27 17:20     ` Jesse Barnes
2013-02-26 11:05 ` [PATCH 10/13] drm/i915: mark rings which were waiting when hang happened Mika Kuoppala
2013-02-26 11:05 ` [PATCH 11/13] drm/i915: add batch object and context to i915_add_request() Mika Kuoppala
2013-02-26 14:22   ` Chris Wilson
2013-02-26 11:05 ` [PATCH 12/13] drm/i915: find guilty batch buffer on ring resets Mika Kuoppala
2013-02-26 11:05 ` [PATCH 13/13] drm/i915: refuse to submit more batchbuffers from guilty context Mika Kuoppala

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=20130226230337.GC3759@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.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