diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 853d6741d3a5..6753fc861dbb 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -1951,6 +1951,12 @@ int i915_reset_engine(struct intel_engine_cs *engine) } ret = intel_gpu_reset(engine->i915, intel_engine_flag(engine)); + if (ret) { + /* If we fail here, we expect to fallback to a global reset */ + DRM_DEBUG_DRIVER("Failed to reset %s, ret=%d\n", + engine->name, ret); + goto out; + } /* * The request that caused the hang is stuck on elsp, we know the @@ -1959,15 +1965,6 @@ int i915_reset_engine(struct intel_engine_cs *engine) */ i915_gem_reset_engine(engine, active_request); - i915_gem_reset_finish_engine(engine); - - if (ret) { - /* If we fail here, we expect to fallback to a global reset */ - DRM_DEBUG_DRIVER("Failed to reset %s, ret=%d\n", - engine->name, ret); - goto out; - } - /* * The engine and its registers (and workarounds in case of render) * have been reset to their default values. Follow the init_ring @@ -1979,6 +1976,7 @@ int i915_reset_engine(struct intel_engine_cs *engine) error->reset_engine_count[engine->id]++; out: + i915_gem_reset_finish_engine(engine); return ret; }