From 310eaeb60579110c5a8e2f31d87ec659ab66b3b8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 5 Jun 2017 11:55:57 +0100 Subject: lib: Force global reset + uevents for hang detector The hang detector relies on a uevent for notification and aborting the test. As proposed, fine-grained resets may not produce a global uevent and so this hang detection becomes void. As we don't expect any hang, we can just reduce the reset to only a global + uevent and so maintain functionality, and switch back to fine-grained resets afterwards. Note that any test that requires testing fine-grained resets should ensure that they are enabled first as igt may leave the global parameters in an inconsistent state. v2: Restore fine-grained resets for explict igt_allow_hang() Signed-off-by: Chris Wilson Cc: Michel Thierry Reviewed-by: Michel Thierry --- lib/igt_aux.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/igt_aux.c') diff --git a/lib/igt_aux.c b/lib/igt_aux.c index f76e55d5..eb563f72 100644 --- a/lib/igt_aux.c +++ b/lib/igt_aux.c @@ -58,6 +58,7 @@ #include "igt_debugfs.h" #include "igt_gt.h" #include "igt_rand.h" +#include "igt_sysfs.h" #include "config.h" #include "intel_reg.h" #include "ioctl_wrappers.h" @@ -451,6 +452,15 @@ void igt_fork_hang_detector(int fd) igt_assert(fstat(fd, &st) == 0); + /* + * Disable per-engine reset to force an error uevent. We don't + * expect to get any hangs whilst the detector is enabled (if we do + * they are a test failure!) and so the loss of per-engine reset + * functionality is not an issue. + */ + igt_assert(igt_sysfs_set_parameter + (fd, "reset", "%d", 1 /* only global reset */)); + signal(SIGIO, sig_abort); igt_fork_helper(&hang_detector) hang_detector_process(getppid(), st.st_rdev); -- cgit v1.2.3