drm/i915: Cancel reset preparations on failed resets
Our reset handling has a retry layer further up in the chain. As we have told the engine to prepare for reset, and failed it, make sure to remove that preparation so that the next attempted reset has a clean slate by triggering another full prepare cycle for the engines. v2: ret as int, simplified cleanup (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20180605160357.32591-1-mika.kuoppala@linux.intel.com
This commit is contained in:
parent
17f297b427
commit
c30acb04e7
|
@ -2093,21 +2093,25 @@ static int gen8_reset_engines(struct drm_i915_private *dev_priv,
|
||||||
{
|
{
|
||||||
struct intel_engine_cs *engine;
|
struct intel_engine_cs *engine;
|
||||||
unsigned int tmp;
|
unsigned int tmp;
|
||||||
|
int ret;
|
||||||
|
|
||||||
for_each_engine_masked(engine, dev_priv, engine_mask, tmp)
|
for_each_engine_masked(engine, dev_priv, engine_mask, tmp) {
|
||||||
if (gen8_reset_engine_start(engine))
|
if (gen8_reset_engine_start(engine)) {
|
||||||
|
ret = -EIO;
|
||||||
goto not_ready;
|
goto not_ready;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 11)
|
if (INTEL_GEN(dev_priv) >= 11)
|
||||||
return gen11_reset_engines(dev_priv, engine_mask);
|
ret = gen11_reset_engines(dev_priv, engine_mask);
|
||||||
else
|
else
|
||||||
return gen6_reset_engines(dev_priv, engine_mask);
|
ret = gen6_reset_engines(dev_priv, engine_mask);
|
||||||
|
|
||||||
not_ready:
|
not_ready:
|
||||||
for_each_engine_masked(engine, dev_priv, engine_mask, tmp)
|
for_each_engine_masked(engine, dev_priv, engine_mask, tmp)
|
||||||
gen8_reset_engine_cancel(engine);
|
gen8_reset_engine_cancel(engine);
|
||||||
|
|
||||||
return -EIO;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef int (*reset_func)(struct drm_i915_private *, unsigned engine_mask);
|
typedef int (*reset_func)(struct drm_i915_private *, unsigned engine_mask);
|
||||||
|
|
Loading…
Reference in New Issue