From mboxrd@z Thu Jan 1 00:00:00 1970 From: Damien Lespiau Subject: Re: [PATCH] drm/i915: Double check ring is idle before declaring the GPU wedged Date: Mon, 11 Aug 2014 10:30:09 +0100 Message-ID: <20140811093009.GA15201@strange.ger.corp.intel.com> References: <1407745295-13830-1-git-send-email-chris@chris-wilson.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EE8B89811 for ; Mon, 11 Aug 2014 02:30:12 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1407745295-13830-1-git-send-email-chris@chris-wilson.co.uk> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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? -- Damien