From a53b962cf74faa873d146e88c2735d7cb7a03b97 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 22 Apr 2014 16:46:16 +0100 Subject: [PATCH] retry-ring-initialisation --- drivers/gpu/drm/i915/intel_ringbuffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 12c59e945f8e..322394c7cb9f 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c @@ -482,6 +482,7 @@ static int init_ring_common(struct intel_ring_buffer *ring) struct drm_device *dev = ring->dev; struct drm_i915_private *dev_priv = dev->dev_private; struct drm_i915_gem_object *obj = ring->obj; + int retry = 3; int ret = 0; gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL); @@ -521,6 +522,7 @@ static int init_ring_common(struct intel_ring_buffer *ring) else ring_setup_phys_status_page(ring); +reset: /* Initialize the ring. This must happen _after_ we've cleared the ring * registers with the above sequence (the readback of the HEAD registers * also enforces ordering), otherwise the hw might lose the new ring @@ -548,6 +550,9 @@ static int init_ring_common(struct intel_ring_buffer *ring) if (wait_for((I915_READ_CTL(ring) & RING_VALID) != 0 && I915_READ_START(ring) == i915_gem_obj_ggtt_offset(obj) && (I915_READ_HEAD(ring) & HEAD_ADDR) == 8, 1000)) { + if (retry-- && stop_ring(ring)) + goto reset; + DRM_ERROR("%s initialization failed " "ctl %08x (valid? %d) head %08x tail %08x start %08x [expected %08lx]\n", ring->name, -- 1.9.2