Commit 7807a76b authored by Chris Wilson's avatar Chris Wilson

drm/i915/gt: Take responsibility for engine->release as the last step

In order to avoid a double cleanup on error, take ownership of
engine->release past the point of no [error] return.
Reported-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Fixes: e26b6d43 ("drm/i915/gt: Pull GT initialisation under intel_gt_init()")
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Tested-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200107143118.3288995-1-chris@chris-wilson.co.uk
parent 05a8e451
...@@ -3925,7 +3925,6 @@ logical_ring_default_vfuncs(struct intel_engine_cs *engine) ...@@ -3925,7 +3925,6 @@ logical_ring_default_vfuncs(struct intel_engine_cs *engine)
{ {
/* Default vfuncs which can be overriden by each engine. */ /* Default vfuncs which can be overriden by each engine. */
engine->release = execlists_release;
engine->resume = execlists_resume; engine->resume = execlists_resume;
engine->cops = &execlists_context_ops; engine->cops = &execlists_context_ops;
...@@ -4040,6 +4039,9 @@ int intel_execlists_submission_setup(struct intel_engine_cs *engine) ...@@ -4040,6 +4039,9 @@ int intel_execlists_submission_setup(struct intel_engine_cs *engine)
reset_csb_pointers(engine); reset_csb_pointers(engine);
/* Finally, take ownership and responsibility for cleanup! */
engine->release = execlists_release;
return 0; return 0;
} }
......
...@@ -1840,8 +1840,6 @@ static void setup_common(struct intel_engine_cs *engine) ...@@ -1840,8 +1840,6 @@ static void setup_common(struct intel_engine_cs *engine)
setup_irq(engine); setup_irq(engine);
engine->release = ring_release;
engine->resume = xcs_resume; engine->resume = xcs_resume;
engine->reset.prepare = reset_prepare; engine->reset.prepare = reset_prepare;
engine->reset.rewind = reset_rewind; engine->reset.rewind = reset_rewind;
...@@ -2007,6 +2005,9 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine) ...@@ -2007,6 +2005,9 @@ int intel_ring_submission_setup(struct intel_engine_cs *engine)
GEM_BUG_ON(timeline->hwsp_ggtt != engine->status_page.vma); GEM_BUG_ON(timeline->hwsp_ggtt != engine->status_page.vma);
/* Finally, take ownership and responsibility for cleanup! */
engine->release = ring_release;
return 0; return 0;
err_ring: err_ring:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment