All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] lib: Force global reset + uevents for hang detector
@ 2017-06-05 11:05 Chris Wilson
  2017-06-05 11:15 ` Mika Kuoppala
  2017-06-05 12:13 ` [PATCH igt v2] " Chris Wilson
  0 siblings, 2 replies; 8+ messages in thread
From: Chris Wilson @ 2017-06-05 11:05 UTC (permalink / raw)
  To: intel-gfx

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.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
cc: Michel Thierr <michel.thierry@intel.com>
---
 lib/igt_aux.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 1222806c..ca2feac3 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -60,6 +60,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"
@@ -443,12 +444,34 @@ static void sig_abort(int sig)
 	igt_assert(!"GPU hung");
 }
 
+static bool set_parameter(int fd, const char *parameter, int value)
+{
+	int dir;
+
+	dir = igt_sysfs_open_parameters(fd);
+	if (dir < 0)
+		return false;
+
+	igt_sysfs_printf(dir, parameter, "%d", value);
+	close(dir);
+
+	return true;
+}
+
 void igt_fork_hang_detector(int fd)
 {
 	struct stat st;
 
 	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(set_parameter(fd, "reset", 1 /* global reset only */));
+
 	signal(SIGIO, sig_abort);
 	igt_fork_helper(&hang_detector)
 		hang_detector_process(getppid(), st.st_rdev);
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-06-05 23:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 11:05 [PATCH igt] lib: Force global reset + uevents for hang detector Chris Wilson
2017-06-05 11:15 ` Mika Kuoppala
2017-06-05 12:00   ` Chris Wilson
2017-06-05 12:23   ` Chris Wilson
2017-06-05 12:13 ` [PATCH igt v2] " Chris Wilson
2017-06-05 21:21   ` Michel Thierry
2017-06-05 22:57     ` Chris Wilson
2017-06-05 23:14       ` Michel Thierry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.