]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/i915/selftests: Hold task reference to reset worker
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 20 Nov 2018 12:06:01 +0000 (12:06 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 20 Nov 2018 14:32:16 +0000 (14:32 +0000)
As the worker may exit by itself, we need to hold a task reference to it
in the parent.

References: https://bugs.freedesktop.org/show_bug.cgi?id=108735
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181120120601.24083-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/selftests/intel_hangcheck.c

index 51d0e2bed9e159b51c6c0445bf18dedc0026163a..defe671130abfb99cccb4209b230673b4f6fb929 100644 (file)
@@ -1150,6 +1150,7 @@ static int __igt_reset_evict_vma(struct drm_i915_private *i915,
                tsk = NULL;
                goto out_reset;
        }
+       get_task_struct(tsk);
 
        wait_for_completion(&arg.completion);
 
@@ -1172,6 +1173,8 @@ out_reset:
                /* The reset, even indirectly, should take less than 10ms. */
                igt_wedge_on_timeout(&w, i915, HZ / 10 /* 100ms timeout*/)
                        err = kthread_stop(tsk);
+
+               put_task_struct(tsk);
        }
 
        mutex_lock(&i915->drm.struct_mutex);