diff options
-rw-r--r-- | drivers/gpu/drm/i915/intel_breadcrumbs.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c index 5f8b9f1f40f1..bcbc7abe6693 100644 --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c | |||
@@ -186,7 +186,7 @@ void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine) | |||
186 | struct intel_wait *wait, *n, *first; | 186 | struct intel_wait *wait, *n, *first; |
187 | 187 | ||
188 | if (!b->irq_armed) | 188 | if (!b->irq_armed) |
189 | return; | 189 | goto wakeup_signaler; |
190 | 190 | ||
191 | /* We only disarm the irq when we are idle (all requests completed), | 191 | /* We only disarm the irq when we are idle (all requests completed), |
192 | * so if the bottom-half remains asleep, it missed the request | 192 | * so if the bottom-half remains asleep, it missed the request |
@@ -208,6 +208,14 @@ void intel_engine_disarm_breadcrumbs(struct intel_engine_cs *engine) | |||
208 | b->waiters = RB_ROOT; | 208 | b->waiters = RB_ROOT; |
209 | 209 | ||
210 | spin_unlock_irq(&b->rb_lock); | 210 | spin_unlock_irq(&b->rb_lock); |
211 | |||
212 | /* | ||
213 | * The signaling thread may be asleep holding a reference to a request, | ||
214 | * that had its signaling cancelled prior to being preempted. We need | ||
215 | * to kick the signaler, just in case, to release any such reference. | ||
216 | */ | ||
217 | wakeup_signaler: | ||
218 | wake_up_process(b->signaler); | ||
211 | } | 219 | } |
212 | 220 | ||
213 | static bool use_fake_irq(const struct intel_breadcrumbs *b) | 221 | static bool use_fake_irq(const struct intel_breadcrumbs *b) |
@@ -651,23 +659,15 @@ static int intel_breadcrumbs_signaler(void *arg) | |||
651 | } | 659 | } |
652 | 660 | ||
653 | if (unlikely(do_schedule)) { | 661 | if (unlikely(do_schedule)) { |
654 | DEFINE_WAIT(exec); | ||
655 | |||
656 | if (kthread_should_park()) | 662 | if (kthread_should_park()) |
657 | kthread_parkme(); | 663 | kthread_parkme(); |
658 | 664 | ||
659 | if (kthread_should_stop()) { | 665 | if (unlikely(kthread_should_stop())) { |
660 | GEM_BUG_ON(request); | 666 | i915_gem_request_put(request); |
661 | break; | 667 | break; |
662 | } | 668 | } |
663 | 669 | ||
664 | if (request) | ||
665 | add_wait_queue(&request->execute, &exec); | ||
666 | |||
667 | schedule(); | 670 | schedule(); |
668 | |||
669 | if (request) | ||
670 | remove_wait_queue(&request->execute, &exec); | ||
671 | } | 671 | } |
672 | i915_gem_request_put(request); | 672 | i915_gem_request_put(request); |
673 | } while (1); | 673 | } while (1); |