summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-07-14 00:09:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2020-09-03 13:52:05 +0100
commitb274d13b0aa562493bebdf3e853bdc532c43b09a (patch)
treeeb722403a4a2e2daccf4261e4e47d88f075c826f
parent777d54491b4dc700c15e4109c9c91bd026ae724e (diff)
close-race-hang
-rw-r--r--tests/i915/gem_close_race.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/i915/gem_close_race.c b/tests/i915/gem_close_race.c
index 4b72d353..c4ca54f8 100644
--- a/tests/i915/gem_close_race.c
+++ b/tests/i915/gem_close_race.c
@@ -169,6 +169,7 @@ static void crashme_now(int sig)
static void thread(int fd, struct drm_gem_open name,
int timeout, unsigned int flags)
#define CONTEXTS 0x1
+#define HANG 0x2
{
struct sigevent sev;
struct sigaction act;
@@ -180,6 +181,9 @@ static void thread(int fd, struct drm_gem_open name,
history = malloc(sizeof(*history) * N_HISTORY);
igt_assert(history);
+ if (flags & HANG)
+ igt_fork_hang_helper();
+
memset(&act, 0, sizeof(act));
act.sa_handler = crashme_now;
igt_assert(sigaction(SIGRTMIN, &act, NULL) == 0);
@@ -244,6 +248,9 @@ static void threads(int timeout, unsigned int flags)
gem_quiescent_gpu(fd);
close(fd);
+
+ if (flags & HANG)
+ igt_stop_hang_helper();
}
igt_main
@@ -283,5 +290,8 @@ igt_main
threads(150, 0);
igt_fixture
- igt_stop_hang_detector();
+ igt_stop_hang_detector();
+
+ igt_subtest("hang")
+ threads(3600, HANG);
}