]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
drm/i915/execlists: Wait for ELSP submission on restart
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 22 May 2018 10:19:37 +0000 (11:19 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 25 May 2018 12:39:49 +0000 (13:39 +0100)
After a reset, we will ensure that there is at least one request
submitted to HW to ensure that a context is loaded for powersaving.
Let's wait for this submission via a tasklet to complete before we drop
our forcewake, ensuring the system is ready for rc6 before we let it
possibly sleep.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180522101937.7738-1-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
drivers/gpu/drm/i915/i915_gem.h
drivers/gpu/drm/i915/intel_lrc.c

index 62ee4e38536582d70b149a9a09b52dde8764e869..261da577829a61b1c84ae8ab2d91bc6d307a6e0d 100644 (file)
@@ -82,4 +82,10 @@ static inline void __tasklet_disable_sync_once(struct tasklet_struct *t)
                tasklet_unlock_wait(t);
 }
 
+static inline void __tasklet_enable_sync_once(struct tasklet_struct *t)
+{
+       if (atomic_dec_return(&t->count) == 0)
+               tasklet_kill(t);
+}
+
 #endif /* __I915_GEM_H__ */
index 302af60415a37a243d8db73ef94ecf902573f79c..4bcd3206991dacf3b073ce9a6a9ad52218766c5f 100644 (file)
@@ -2008,7 +2008,16 @@ static void execlists_reset(struct intel_engine_cs *engine,
 
 static void execlists_reset_finish(struct intel_engine_cs *engine)
 {
-       tasklet_enable(&engine->execlists.tasklet);
+       /*
+        * Flush the tasklet while we still have the forcewake to be sure
+        * that it is not allowed to sleep before we restart and reload a
+        * context.
+        *
+        * As before (with execlists_reset_prepare) we rely on the caller
+        * serialising multiple attempts to reset so that we know that we
+        * are the only one manipulating tasklet state.
+        */
+       __tasklet_enable_sync_once(&engine->execlists.tasklet);
 
        GEM_TRACE("%s\n", engine->name);
 }