From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Double check ring is idle before declaring the GPU wedged Date: Mon, 11 Aug 2014 13:34:11 +0200 Message-ID: <20140811113411.GO8727@phenom.ffwll.local> References: <1407745295-13830-1-git-send-email-chris@chris-wilson.co.uk> <20140811093009.GA15201@strange.ger.corp.intel.com> <20140811093525.GD6666@nuc-i3427.alporthouse.com> <20140811100710.GA21988@strange.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by gabe.freedesktop.org (Postfix) with ESMTP id E93AB89065 for ; Mon, 11 Aug 2014 04:33:59 -0700 (PDT) Received: by mail-we0-f170.google.com with SMTP id w62so8403861wes.29 for ; Mon, 11 Aug 2014 04:33:59 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140811100710.GA21988@strange.ger.corp.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Damien Lespiau Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Mon, Aug 11, 2014 at 11:07:10AM +0100, Damien Lespiau wrote: > On Mon, Aug 11, 2014 at 10:35:25AM +0100, Chris Wilson wrote: > > On Mon, Aug 11, 2014 at 10:30:09AM +0100, Damien Lespiau wrote: > > > 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 > > > > Cc: Damien Lespiau > > > > --- > > > > 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? > > > > It is still a 1 second timeout, so having a warning there that something > > is wrong is important I thought. > > Ah, I missed the "not in production hw" bits of the commit message, It > may mean simulation and then the guess is that flag is not implemented. > If that makes us not totally give up, I guess that's something. > > Reviewed-by: Damien Lespiau Queued for -next, thanks for the patch. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch