[Intel-gfx] [PATCH] drm/i915/execlists: Keep context alive until after we kick

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Fri Jun 21 08:07:44 UTC 2019


On 21/06/2019 08:33, Chris Wilson wrote:
> The call to kick_siblings() dereferences the rq->context, so we should
> not drop our local reference until afterwards!
> 
> Fixes: 22b7a426bbe1 ("drm/i915/execlists: Preempt-to-busy")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>   drivers/gpu/drm/i915/gt/intel_lrc.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/intel_lrc.c b/drivers/gpu/drm/i915/gt/intel_lrc.c
> index 6522801af2d6..a9493f2cb38f 100644
> --- a/drivers/gpu/drm/i915/gt/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/intel_lrc.c
> @@ -544,9 +544,6 @@ execlists_schedule_out(struct i915_request *rq)
>   		intel_engine_context_out(ce->inflight);
>   		execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_OUT);
>   
> -		ce->inflight = NULL;
> -		intel_context_put(ce);
> -
>   		/*
>   		 * If this is part of a virtual engine, its next request may
>   		 * have been blocked waiting for access to the active context.
> @@ -558,6 +555,9 @@ execlists_schedule_out(struct i915_request *rq)
>   		 */
>   		if (rq->engine != ce->engine)
>   			kick_siblings(rq, ce);
> +
> +		ce->inflight = NULL;
> +		intel_context_put(ce);
>   	}
>   
>   	i915_request_put(rq);
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko


More information about the Intel-gfx mailing list