aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-03-07 08:42:26 -0500
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2018-03-16 08:35:35 -0400
commit73e2232aa3253d77935112bfc218700f6a2f1000 (patch)
treee7cd5ca947a0e1df1bd4e1ef8abdb794945a2e3c /drivers
parent7e9d3a4a1b21fd8a595774697f4047e7505deea6 (diff)
drm/i915: Only call tasklet_kill() on the first prepare_reset
tasklet_kill() will spin waiting for the current tasklet to be executed. However, if tasklet_disable() has been called, then the tasklet is never executed but permanently put back onto the runlist until tasklet_enable() is called. Ergo, we cannot use tasklet_kill() inside a disable/enable pair. This is the case when we call set-wedge from inside i915_reset(), and another request was submitted to us concurrent to the reset. Fixes: 963ddd63c314 ("drm/i915: Suspend submission tasklets around wedging") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180307134226.25492-6-chris@chris-wilson.co.uk (cherry picked from commit 68ad361285a9cc73b259f59adbaafde196c15987) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8d913d833ab9..0359d6f870b4 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2940,8 +2940,16 @@ i915_gem_reset_prepare_engine(struct intel_engine_cs *engine)
2940 * calling engine->init_hw() and also writing the ELSP. 2940 * calling engine->init_hw() and also writing the ELSP.
2941 * Turning off the execlists->tasklet until the reset is over 2941 * Turning off the execlists->tasklet until the reset is over
2942 * prevents the race. 2942 * prevents the race.
2943 *
2944 * Note that this needs to be a single atomic operation on the
2945 * tasklet (flush existing tasks, prevent new tasks) to prevent
2946 * a race between reset and set-wedged. It is not, so we do the best
2947 * we can atm and make sure we don't lock the machine up in the more
2948 * common case of recursively being called from set-wedged from inside
2949 * i915_reset.
2943 */ 2950 */
2944 tasklet_kill(&engine->execlists.tasklet); 2951 if (!atomic_read(&engine->execlists.tasklet.count))
2952 tasklet_kill(&engine->execlists.tasklet);
2945 tasklet_disable(&engine->execlists.tasklet); 2953 tasklet_disable(&engine->execlists.tasklet);
2946 2954
2947 /* 2955 /*