drm/i915: Flush the irq and tasklets before asserting engine is idle
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Nov 2017 20:21:49 +0000 (20:21 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 2 Nov 2017 11:24:59 +0000 (11:24 +0000)
Before we assert that the engine is idle, make sure we flush any
residual tasklet. After that point, if the engine is not idle, more work
may be queued despite us trying to park the engine and go to sleep.

References: https://bugs.freedesktop.org/show_bug.cgi?id=103479
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171101202149.32493-1-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
drivers/gpu/drm/i915/intel_engine_cs.c

index 6895a90af008369fb1aeecd863ca90ef04782dbf..ddbe5c9bf45abd1df81c3235751acf90ae5d7f92 100644 (file)
@@ -1614,6 +1614,10 @@ void intel_engines_park(struct drm_i915_private *i915)
        enum intel_engine_id id;
 
        for_each_engine(engine, i915, id) {
+               /* Flush the residual irq tasklets first. */
+               intel_engine_disarm_breadcrumbs(engine);
+               tasklet_kill(&engine->execlists.irq_tasklet);
+
                /*
                 * We are committed now to parking the engines, make sure there
                 * will be no more interrupts arriving later and the engines
@@ -1630,9 +1634,6 @@ void intel_engines_park(struct drm_i915_private *i915)
                if (engine->park)
                        engine->park(engine);
 
-               intel_engine_disarm_breadcrumbs(engine);
-               tasklet_kill(&engine->execlists.irq_tasklet);
-
                i915_gem_batch_pool_fini(&engine->batch_pool);
                engine->execlists.no_priolist = false;
        }