drm/i915: Kill the tasklet then disable
authorChris Wilson <[email protected]>
Sun, 12 Feb 2017 17:20:00 +0000 (17:20 +0000)
committerChris Wilson <[email protected]>
Mon, 13 Feb 2017 11:18:23 +0000 (11:18 +0000)
Disabling the tasklet leaves it if scheduled on the ready to run list
until it is re-enabled. This will leave the ksoftird thread spinning
until satisfied. To prevent this situation on starting the GPU reset, we
want to kill the tasklet first and then disable. The same problem will
arise when a tasklet is scheduled from another device, so a better
solution is required for the general case.

Reported-by: Tvrtko Ursulin <[email protected]>
Fixes: 1f7b847d72c3 ("drm/i915: Disable engine->irq_tasklet around resets")
Signed-off-by: Chris Wilson <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: Mika Kuoppala <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Mika Kuoppala <[email protected]>
drivers/gpu/drm/i915/i915_gem.c

index 48922ff454e6b02c194d6755e789fdb52de1fed9..3c2c2296c1dcf3c867f74a95a91dbd7fac7c32e5 100644 (file)
@@ -2651,8 +2651,8 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv)
                 * Turning off the engine->irq_tasklet until the reset is over
                 * prevents the race.
                 */
-               tasklet_disable(&engine->irq_tasklet);
                tasklet_kill(&engine->irq_tasklet);
+               tasklet_disable(&engine->irq_tasklet);
 
                if (engine->irq_seqno_barrier)
                        engine->irq_seqno_barrier(engine);