[Intel-gfx] [PATCH] drm/i915: Fix the port submission race during engine reset in execlists mode

Chuanxiao Dong chuanxiao.dong at intel.com
Wed Jul 19 08:14:14 UTC 2017


During the engine reset, there is a race condition which can make the
request submitted to HW twice. This is due to the irq tasklet function
enabled too earliy which is just before init_hw callback. This patch
will move the irq tasklet enabling after init_hw to resolve this race.

Fixes: a1ef70e14453 ("drm/i915: Add support for per engine reset recovery")
Cc: Michel Thierry <michel.thierry at intel.com>
Signed-off-by: Chuanxiao Dong <chuanxiao.dong at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index d310d82..e2f0222 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1963,9 +1963,6 @@ int i915_reset_engine(struct intel_engine_cs *engine)
 
 	/* Finally, reset just this engine. */
 	ret = intel_gpu_reset(engine->i915, intel_engine_flag(engine));
-
-	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",
@@ -1984,6 +1981,8 @@ int i915_reset_engine(struct intel_engine_cs *engine)
 
 	error->reset_engine_count[engine->id]++;
 out:
+	i915_gem_reset_finish_engine(engine);
+
 	return ret;
 }
 
-- 
2.7.4



More information about the Intel-gfx mailing list