Quoting Chris Wilson (2019-06-17 09:40:44) > Though we pin the context first before taking the pm wakeref, during > retire we need to unpin before dropping the pm wakeref (breaking the > "natural" onion). During the unpin, we may need to attach a cleanup > operation on to the engine wakeref, ergo we want to keep the engine > awake until after the unpin. > > Fixes: ce476c80b8bf ("drm/i915: Keep contexts pinned until after the next kernel context switch") > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx> > --- > drivers/gpu/drm/i915/i915_request.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c > index 9819483d1b5d..8d952bc03d5c 100644 > --- a/drivers/gpu/drm/i915/i915_request.c > +++ b/drivers/gpu/drm/i915/i915_request.c > @@ -250,8 +250,9 @@ static bool i915_request_retire(struct i915_request *rq) > > local_irq_enable(); > > - intel_context_exit(rq->hw_context); > + /* Onion reversed to keep engine alive until after unpinning */ > intel_context_unpin(rq->hw_context); > + intel_context_exit(rq->hw_context); The alternative is to keep the onion unwind here and to add the engine wakerefs into the barriers. Hmm. That seems like it should be more foolproof, perhaps? -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx