From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 2/2] drm/i915: Add wait_for in init_ring_common Date: Fri, 16 Mar 2012 18:34:41 +0000 Message-ID: <20120316183441.GA26888@cloud01> References: <1331916202-20638-1-git-send-email-seanpaul@chromium.org> <1331916202-20638-3-git-send-email-seanpaul@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id A84549E8F2 for ; Fri, 16 Mar 2012 11:32:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1331916202-20638-3-git-send-email-seanpaul@chromium.org> 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: Sean Paul Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Mar 16, 2012 at 12:43:22PM -0400, Sean Paul wrote: > I have seen a number of "blt ring initialization failed" messages > where the ctl or start registers are not the correct value. Upon further > inspection, if the code just waited a little bit, it would read the > correct value. Adding the wait_for to these reads should eliminate the > issue. > > Signed-off-by: Sean Paul Reviewed-by: Ben Widawsky > --- > drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c > index 8357822..d95f0f9 100644 > --- a/drivers/gpu/drm/i915/intel_ringbuffer.c > +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c > @@ -298,9 +298,9 @@ static int init_ring_common(struct intel_ring_buffer *ring) > | RING_REPORT_64K | RING_VALID); > > /* If the head is still not zero, the ring is dead */ > - if ((I915_READ_CTL(ring) & RING_VALID) == 0 || > - I915_READ_START(ring) != obj->gtt_offset || > - (I915_READ_HEAD(ring) & HEAD_ADDR) != 0) { > + if (wait_for((I915_READ_CTL(ring) & RING_VALID) != 0 && > + I915_READ_START(ring) == obj->gtt_offset && > + (I915_READ_HEAD(ring) & HEAD_ADDR) == 0, 50)) { > DRM_ERROR("%s initialization failed " > "ctl %08x head %08x tail %08x start %08x\n", > ring->name, > -- > 1.7.7.3 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx