Skip to content

Commit 61089fc

Browse files
ickleJoseph Salisbury
authored andcommitted
drm/i915: Reorder the semaphore deadlock check, again
BugLink: http://bugs.launchpad.net/bugs/1356913 commit a0d036b upstream. commit 4be1738 Author: Chris Wilson <[email protected]> Date: Fri Jun 6 10:22:29 2014 +0100 drm/i915: Reorder semaphore deadlock check did the majority of the work, but it missed one crucial detail: The check for the unkickable deadlock on this ring must come after the check whether the ring that we are waiting on has already passed its target seqno. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80709 Tested-by: Stefan Huber <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Cc: Mika Kuoppala <[email protected]> Cc: Jani Nikula <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Signed-off-by: Kamal Mostafa <[email protected]> Signed-off-by: Joseph Salisbury <[email protected]>
1 parent cb6bc72 commit 61089fc

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/gpu/drm/i915/i915_irq.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2394,7 +2394,7 @@ static int semaphore_passed(struct intel_ring_buffer *ring)
23942394
{
23952395
struct drm_i915_private *dev_priv = ring->dev->dev_private;
23962396
struct intel_ring_buffer *signaller;
2397-
u32 seqno, ctl;
2397+
u32 seqno;
23982398

23992399
ring->hangcheck.deadlock++;
24002400

@@ -2406,15 +2406,12 @@ static int semaphore_passed(struct intel_ring_buffer *ring)
24062406
if (signaller->hangcheck.deadlock >= I915_NUM_RINGS)
24072407
return -1;
24082408

2409-
/* cursory check for an unkickable deadlock */
2410-
ctl = I915_READ_CTL(signaller);
2411-
if (ctl & RING_WAIT_SEMAPHORE && semaphore_passed(signaller) < 0)
2412-
return -1;
2413-
24142409
if (i915_seqno_passed(signaller->get_seqno(signaller, false), seqno))
24152410
return 1;
24162411

2417-
if (signaller->hangcheck.deadlock)
2412+
/* cursory check for an unkickable deadlock */
2413+
if (I915_READ_CTL(signaller) & RING_WAIT_SEMAPHORE &&
2414+
semaphore_passed(signaller) < 0)
24182415
return -1;
24192416

24202417
return 0;

0 commit comments

Comments
 (0)