aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/selftests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-11-01 08:49:40 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-11-01 10:12:29 +0000
commite5661c6ab0efd0dd0140a0f521b6e9f6a26a5071 (patch)
tree99446cddd13e1d8d9d6225de6cd7f32926c480e0 /drivers/gpu/drm/i915/selftests
parentdrm/i915/lmem: Check against i915_selftest only under CONFIG_SELFTEST (diff)
downloadlinux-dev-e5661c6ab0efd0dd0140a0f521b6e9f6a26a5071.tar.xz
linux-dev-e5661c6ab0efd0dd0140a0f521b6e9f6a26a5071.zip
drm/i915/selftests: Start kthreads before stopping
An interesting observation made with our parallel selftests was that on our small/single cpu systems we would call kthread_stop() before the kthreads were spawned. If this happens, the kthread is never run at all; completely bypassing the test. A simple yield() from the parent will ensure that all children have the opportunity to start before we reap them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20191101084940.31838-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests')
-rw-r--r--drivers/gpu/drm/i915/selftests/i915_request.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/selftests/i915_request.c b/drivers/gpu/drm/i915/selftests/i915_request.c
index 30ae34f62176..8618a4dc0701 100644
--- a/drivers/gpu/drm/i915/selftests/i915_request.c
+++ b/drivers/gpu/drm/i915/selftests/i915_request.c
@@ -464,6 +464,7 @@ static int mock_breadcrumbs_smoketest(void *arg)
get_task_struct(threads[n]);
}
+ yield(); /* start all threads before we begin */
msleep(jiffies_to_msecs(i915_selftest.timeout_jiffies));
for (n = 0; n < ncpus; n++) {
@@ -1158,6 +1159,8 @@ static int live_parallel_engines(void *arg)
get_task_struct(tsk[idx++]);
}
+ yield(); /* start all threads before we kthread_stop() */
+
idx = 0;
for_each_uabi_engine(engine, i915) {
int status;
@@ -1314,6 +1317,7 @@ static int live_breadcrumbs_smoketest(void *arg)
idx++;
}
+ yield(); /* start all threads before we begin */
msleep(jiffies_to_msecs(i915_selftest.timeout_jiffies));
out_flush: