aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-11-20 07:06:01 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2018-11-20 09:32:16 -0500
commite32c8d3caefbb8ec734a0a79c8d4245f38c99d2a (patch)
treebeceacb272654e93d0c3feb7a73e9355ce5d20f3
parent2ac5e38ea4203852d6e99edd3cf11f044b0a409f (diff)
drm/i915/selftests: Hold task reference to reset worker
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
-rw-r--r--drivers/gpu/drm/i915/selftests/intel_hangcheck.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
index 51d0e2bed9e1..defe671130ab 100644
--- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
+++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
@@ -1150,6 +1150,7 @@ static int __igt_reset_evict_vma(struct drm_i915_private *i915,
1150 tsk = NULL; 1150 tsk = NULL;
1151 goto out_reset; 1151 goto out_reset;
1152 } 1152 }
1153 get_task_struct(tsk);
1153 1154
1154 wait_for_completion(&arg.completion); 1155 wait_for_completion(&arg.completion);
1155 1156
@@ -1172,6 +1173,8 @@ out_reset:
1172 /* The reset, even indirectly, should take less than 10ms. */ 1173 /* The reset, even indirectly, should take less than 10ms. */
1173 igt_wedge_on_timeout(&w, i915, HZ / 10 /* 100ms timeout*/) 1174 igt_wedge_on_timeout(&w, i915, HZ / 10 /* 100ms timeout*/)
1174 err = kthread_stop(tsk); 1175 err = kthread_stop(tsk);
1176
1177 put_task_struct(tsk);
1175 } 1178 }
1176 1179
1177 mutex_lock(&i915->drm.struct_mutex); 1180 mutex_lock(&i915->drm.struct_mutex);