Commit 9574b3fe authored by Ben Widawsky's avatar Ben Widawsky Committed by Daniel Vetter
Browse files

drm/i915: kill waiting_seqno



The waiting_seqno is not terribly useful, and as such we can remove it
so that we'll be able to extract lockless code.

v2: Keep the information for error_state (Chris)
Check if ring is initialized in hangcheck (Chris)
Capture the waiting ring (Chris)
Signed-off-by: default avatarBen Widawsky <ben@bwidawsk.net>
[danvet: add some bikeshed to clarify a comment.]
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent be998e2e
...@@ -414,8 +414,6 @@ static void i915_ring_seqno_info(struct seq_file *m, ...@@ -414,8 +414,6 @@ static void i915_ring_seqno_info(struct seq_file *m,
if (ring->get_seqno) { if (ring->get_seqno) {
seq_printf(m, "Current sequence (%s): %d\n", seq_printf(m, "Current sequence (%s): %d\n",
ring->name, ring->get_seqno(ring)); ring->name, ring->get_seqno(ring));
seq_printf(m, "Waiter sequence (%s): %d\n",
ring->name, ring->waiting_seqno);
seq_printf(m, "IRQ sequence (%s): %d\n", seq_printf(m, "IRQ sequence (%s): %d\n",
ring->name, ring->irq_seqno); ring->name, ring->irq_seqno);
} }
...@@ -687,6 +685,7 @@ static void i915_ring_error_state(struct seq_file *m, ...@@ -687,6 +685,7 @@ static void i915_ring_error_state(struct seq_file *m,
error->semaphore_mboxes[ring][1]); error->semaphore_mboxes[ring][1]);
} }
seq_printf(m, " seqno: 0x%08x\n", error->seqno[ring]); seq_printf(m, " seqno: 0x%08x\n", error->seqno[ring]);
seq_printf(m, " waiting: %s\n", yesno(error->waiting[ring]));
seq_printf(m, " ring->head: 0x%08x\n", error->cpu_ring_head[ring]); seq_printf(m, " ring->head: 0x%08x\n", error->cpu_ring_head[ring]);
seq_printf(m, " ring->tail: 0x%08x\n", error->cpu_ring_tail[ring]); seq_printf(m, " ring->tail: 0x%08x\n", error->cpu_ring_tail[ring]);
} }
......
...@@ -174,6 +174,7 @@ struct drm_i915_error_state { ...@@ -174,6 +174,7 @@ struct drm_i915_error_state {
u32 eir; u32 eir;
u32 pgtbl_er; u32 pgtbl_er;
u32 ier; u32 ier;
bool waiting[I915_NUM_RINGS];
u32 pipestat[I915_MAX_PIPES]; u32 pipestat[I915_MAX_PIPES];
u32 tail[I915_NUM_RINGS]; u32 tail[I915_NUM_RINGS];
u32 head[I915_NUM_RINGS]; u32 head[I915_NUM_RINGS];
......
...@@ -1864,7 +1864,6 @@ i915_wait_request(struct intel_ring_buffer *ring, ...@@ -1864,7 +1864,6 @@ i915_wait_request(struct intel_ring_buffer *ring,
if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) { if (!i915_seqno_passed(ring->get_seqno(ring), seqno)) {
trace_i915_gem_request_wait_begin(ring, seqno); trace_i915_gem_request_wait_begin(ring, seqno);
ring->waiting_seqno = seqno;
if (ring->irq_get(ring)) { if (ring->irq_get(ring)) {
if (dev_priv->mm.interruptible) if (dev_priv->mm.interruptible)
ret = wait_event_interruptible(ring->irq_queue, ret = wait_event_interruptible(ring->irq_queue,
...@@ -1880,7 +1879,6 @@ i915_wait_request(struct intel_ring_buffer *ring, ...@@ -1880,7 +1879,6 @@ i915_wait_request(struct intel_ring_buffer *ring,
seqno) || seqno) ||
atomic_read(&dev_priv->mm.wedged), 3000)) atomic_read(&dev_priv->mm.wedged), 3000))
ret = -EBUSY; ret = -EBUSY;
ring->waiting_seqno = 0;
trace_i915_gem_request_wait_end(ring, seqno); trace_i915_gem_request_wait_end(ring, seqno);
} }
......
...@@ -1031,6 +1031,7 @@ static void i915_record_ring_state(struct drm_device *dev, ...@@ -1031,6 +1031,7 @@ static void i915_record_ring_state(struct drm_device *dev,
error->instdone[ring->id] = I915_READ(INSTDONE); error->instdone[ring->id] = I915_READ(INSTDONE);
} }
error->waiting[ring->id] = waitqueue_active(&ring->irq_queue);
error->instpm[ring->id] = I915_READ(RING_INSTPM(ring->mmio_base)); error->instpm[ring->id] = I915_READ(RING_INSTPM(ring->mmio_base));
error->seqno[ring->id] = ring->get_seqno(ring); error->seqno[ring->id] = ring->get_seqno(ring);
error->acthd[ring->id] = intel_ring_get_active_head(ring); error->acthd[ring->id] = intel_ring_get_active_head(ring);
...@@ -1708,14 +1709,17 @@ ring_last_seqno(struct intel_ring_buffer *ring) ...@@ -1708,14 +1709,17 @@ ring_last_seqno(struct intel_ring_buffer *ring)
static bool i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err) static bool i915_hangcheck_ring_idle(struct intel_ring_buffer *ring, bool *err)
{ {
/* We don't check whether the ring even exists before calling this
* function. Hence check whether it's initialized. */
if (ring->obj == NULL)
return true;
if (list_empty(&ring->request_list) || if (list_empty(&ring->request_list) ||
i915_seqno_passed(ring->get_seqno(ring), ring_last_seqno(ring))) { i915_seqno_passed(ring->get_seqno(ring), ring_last_seqno(ring))) {
/* Issue a wake-up to catch stuck h/w. */ /* Issue a wake-up to catch stuck h/w. */
if (ring->waiting_seqno && waitqueue_active(&ring->irq_queue)) { if (waitqueue_active(&ring->irq_queue)) {
DRM_ERROR("Hangcheck timer elapsed... %s idle [waiting on %d, at %d], missed IRQ?\n", DRM_ERROR("Hangcheck timer elapsed... %s idle\n",
ring->name, ring->name);
ring->waiting_seqno,
ring->get_seqno(ring));
wake_up_all(&ring->irq_queue); wake_up_all(&ring->irq_queue);
*err = true; *err = true;
} }
......
...@@ -60,7 +60,6 @@ struct intel_ring_buffer { ...@@ -60,7 +60,6 @@ struct intel_ring_buffer {
u32 irq_enable_mask; /* bitmask to enable ring interrupt */ u32 irq_enable_mask; /* bitmask to enable ring interrupt */
u32 irq_seqno; /* last seq seem at irq time */ u32 irq_seqno; /* last seq seem at irq time */
u32 trace_irq_seqno; u32 trace_irq_seqno;
u32 waiting_seqno;
u32 sync_seqno[I915_NUM_RINGS-1]; u32 sync_seqno[I915_NUM_RINGS-1];
bool __must_check (*irq_get)(struct intel_ring_buffer *ring); bool __must_check (*irq_get)(struct intel_ring_buffer *ring);
void (*irq_put)(struct intel_ring_buffer *ring); void (*irq_put)(struct intel_ring_buffer *ring);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment