From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 05/13] drm/i915: introduce i915_hangcheck_ring_hung Date: Tue, 26 Feb 2013 15:03:38 -0800 Message-ID: <20130226230337.GC3759@bwidawsk.net> References: <1361876716-8625-1-git-send-email-mika.kuoppala@intel.com> <1361876716-8625-6-git-send-email-mika.kuoppala@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from shiva.localdomain (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DEB5E5D37 for ; Tue, 26 Feb 2013 15:01:51 -0800 (PST) Content-Disposition: inline In-Reply-To: <1361876716-8625-6-git-send-email-mika.kuoppala@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Mika Kuoppala Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 > --- > 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