[Intel-gfx] [PATCH 2/5] drm/i915/gt: Restore ce->signal flush before releasing virtual engine

Chris Wilson chris at chris-wilson.co.uk
Fri Jan 8 15:24:47 UTC 2021


Quoting Andi Shyti (2021-01-08 15:18:22)
> Hi Chris,
> 
> > +void intel_context_remove_breadcrumbs(struct intel_context *ce,
> > +                                   struct intel_breadcrumbs *b)
> > +{
> > +     struct i915_request *rq, *rn;
> > +     bool release = false;
> > +     unsigned long flags;
> > +
> > +     spin_lock_irqsave(&ce->signal_lock, flags);
> > +
> > +     if (list_empty(&ce->signals))
> > +             goto unlock;
> 
> does "list_empty" need to be under lock or you've been lazy?

This check is required to be under the lock, we have to be careful about
not calling remove_signaling_context() from here and signal_irq_work.
I put the unlocked check in the caller to avoid the function call as well.
-Chris


More information about the Intel-gfx mailing list