[Intel-gfx] [PATCH 3/3] drm/i915: Skip capturing an error state if we already have one

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Jul 5 10:10:29 UTC 2016


Chris Wilson <chris at chris-wilson.co.uk> writes:

> As we only ever keep the first error state around, we can avoid some
> work that can be quite intrusive if we don't record the error the second
> time around. This does move the race whereby the user could discard one
> error state as the second is being captured, but that race exists in the
> current code and we hope that recapturing error state is only done for
> debugging.
>
> Note that as we discard the error state for simulated errors, igt that
> exercise error capture continue to function.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---

Reading through how the simulated works, we could record rings early and
as such bail out early if context doesn't want error capture.

But this patch makes sense to not provoke our racy capturing for no
gain,

Reviewed-by: Mika Kuoppala <mika.kuoppala at intel.com>

>  drivers/gpu/drm/i915/i915_gpu_error.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
> index c6e05cccbedf..3a43b434c92e 100644
> --- a/drivers/gpu/drm/i915/i915_gpu_error.c
> +++ b/drivers/gpu/drm/i915/i915_gpu_error.c
> @@ -1401,6 +1401,9 @@ void i915_capture_error_state(struct drm_i915_private *dev_priv,
>  	struct drm_i915_error_state *error;
>  	unsigned long flags;
>  
> +	if (READ_ONCE(dev_priv->gpu_error.first_error))
> +		return;
> +
>  	/* Account for pipe specific data like PIPE*STAT */
>  	error = kzalloc(sizeof(*error), GFP_ATOMIC);
>  	if (!error) {
> -- 
> 2.8.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list