[Intel-gfx] [PATCH 04/10] drm/i915/tdr: Modify error handler for per engine hang recovery

Chris Wilson chris at chris-wilson.co.uk
Thu Jan 12 07:27:00 UTC 2017


On Wed, Jan 11, 2017 at 08:18:11PM -0800, Michel Thierry wrote:
> +/**
> + * i915_reset - start either engine or full GPU reset to recover from a hang
> + * @dev_priv: device private
> + *
> + * Wrapper function to initiate a GPU reset. If platform supports it, attempt
> + * to reset the hung engine(s) only. In engine reset fails (or not supported),
> + * reset the full GPU.
> + *
> + * Caller must hold the struct_mutex.
> + */
> +void i915_reset(struct drm_i915_private *dev_priv)

Pass in the engine mask, that will help you when writing the selftests.

> +{
> +	/* If hardware supports it (GEN8+), try engine reset first */
> +	if (intel_has_reset_engine(dev_priv)) {
> +		struct intel_engine_cs *engine;
> +		u32 engine_mask = dev_priv->gpu_error.reset_engine_mask;
> +		unsigned int tmp;
> +
> +		for_each_engine_masked(engine, dev_priv, engine_mask, tmp) {
> +			/* on failure fallback to full gpu reset for recovery */
> +			if (i915_reset_engine(engine))
> +				goto error;
> +		}
> +
> +		return;

This now has inconsistent bit states.

> +	}
> +
> +error:
> +	i915_reset_chip(dev_priv);
> +}

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list