[Intel-gfx] [PATCH 01/32] drm/i915: Seal races between async GPU cancellation, retirement and signaling

Chris Wilson chris at chris-wilson.co.uk
Wed Apr 17 08:46:26 UTC 2019


Quoting Chris Wilson (2019-04-17 08:56:26)
> @@ -294,8 +304,8 @@ void i915_request_cancel_breadcrumb(struct i915_request *rq)
>  {
>         struct intel_breadcrumbs *b = &rq->engine->breadcrumbs;
>  
> -       if (!test_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags))
> -               return;
> +       lockdep_assert_held(&rq->lock);
> +       lockdep_assert_irqs_disabled();
>  
>         spin_lock(&b->irq_lock);
>         if (test_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags)) {

@@ -307,6 +307,12 @@ void i915_request_cancel_breadcrumb(struct i915_request *rq)
        lockdep_assert_held(&rq->lock);
        lockdep_assert_irqs_disabled();

+       /*
+        * We must wait for b->irq_lock so that we know the interrupt handler
+        * has released its reference to the intel_context and has completed
+        * the DMA_FENCE_FLAG_SIGNALED_BIT/I915_FENCE_FLAG_SIGNAL dance (if
+        * required).
+        */
        spin_lock(&b->irq_lock);
        if (test_bit(I915_FENCE_FLAG_SIGNAL, &rq->fence.flags)) {
                struct intel_context *ce = rq->hw_context;

Just a touch of explanation,
-Chris


More information about the Intel-gfx mailing list