[Intel-gfx] [PATCH] drm/i915: Lock the engine while dumping the active request
Chris Wilson
chris at chris-wilson.co.uk
Tue Jul 9 13:58:53 UTC 2019
Quoting Chris Wilson (2019-07-09 14:03:03)
> We cannot let the request be retired and freed while we are trying to
> dump it during error capture. It is not sufficient just to grab a
> reference to the request, as during retirement we may free the ring
> which we are also dumping. So take the engine lock to prevent retiring
> and freeing of the request.
>
> Reported-by: Alex Shumsky <alexthreed at gmail.com>
> Fixes: 83c317832eb1 ("drm/i915: Dump the ringbuffer of the active request for debugging")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Alex Shumsky <alexthreed at gmail.com>
> ---
> drivers/gpu/drm/i915/gt/intel_engine_cs.c | 51 ++++++++++++-----------
> drivers/gpu/drm/i915/i915_gpu_error.c | 6 ++-
> 2 files changed, 30 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> index bdf279fa3b2e..8ee2dd423674 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
> @@ -1444,9 +1444,11 @@ static void intel_engine_print_registers(struct intel_engine_cs *engine,
> }
> }
>
> -static void print_request_ring(struct drm_printer *m, struct i915_request *rq)
> +static void print_request_ring(struct drm_printer *m,
> + const struct i915_request *rq,
> + const struct intel_ring *ring)
This chunk is superfluous. I thought it might be wiser to pin the ring,
but that would be unusual.
-Chris
More information about the Intel-gfx
mailing list