drm/i915/gt: Don't flush the tasklet if not setup
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Jun 2020 18:39:35 +0000 (19:39 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Jun 2020 20:15:02 +0000 (21:15 +0100)
If the tasklet is not being used, don't try and flush it.

Fixes: 594893870044 ("drm/i915/gt: Add a safety submission flush in the heartbeat")
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/20200615183935.17389-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_engine_cs.c

index 31049e0bdb5726ab89911ff01348f446c0633a9b..045179c65c44740bd4d9f6a584c3500db3931569 100644 (file)
@@ -1094,6 +1094,9 @@ void intel_engine_flush_submission(struct intel_engine_cs *engine)
 {
        struct tasklet_struct *t = &engine->execlists.tasklet;
 
+       if (!t->func)
+               return;
+
        /* Synchronise and wait for the tasklet on another CPU */
        tasklet_kill(t);