]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm/i915: detect hang using per ring hangcheck_score
authorMika Kuoppala <mika.kuoppala@linux.intel.com>
Thu, 30 May 2013 06:04:29 +0000 (09:04 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 3 Jun 2013 08:58:21 +0000 (10:58 +0200)
commit05407ff889ceebe383aa5907219f86582ef96b72
treed93841848ec8d135566a085809eb0eb4c7fa85d7
parent35c20a60c7549b11fd1d8c5d5d7ab5b6b54d6ff9
drm/i915: detect hang using per ring hangcheck_score

Keep track of ring seqno progress and if there are no
progress detected, declare hang. Use actual head (acthd)
to distinguish between ring stuck and batchbuffer looping
situation. Stuck ring will be kicked to trigger progress.

This commit adds a hard limit for batchbuffer completion time.
If batchbuffer completion time is more than 4.5 seconds,
the gpu will be declared hung.

Review comment from Ben which nicely clarifies the semantic change:

"Maybe I'm just stating the functional changes of the patch, but in case
they were unintended here is what I see as potential issues:

1. "If ring B is waiting on ring A via semaphore, and ring A is making
   progress, albeit slowly - the hangcheck will fire. The check will
   determine that A is moving, however ring B will appear hung because
   the ACTHD doesn't move. I honestly can't say if that's actually a
   realistic problem to hit it probably implies the timeout value is too
   low.

2. "There's also another corner case on the kick. If the seqno = 2
   (though not stuck), and on the 3rd hangcheck, the ring is stuck, and
   we try to kick it... we don't actually try to find out if the kick
   helped"

v2: use atchd to detect stuck ring from loop (Ben Widawsky)

v3: Use acthd to check when ring needs kicking.
Declare hang on third time in order to give time for
kick_ring to take effect.

v4: Update commit msg

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
[danvet: Paste in Ben's review comment.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c
drivers/gpu/drm/i915/intel_ringbuffer.h