[i-g-t] lib/i915: Restore hangcheck modparams between tests
diff mbox series

Message ID 20200526132548.76656-1-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [i-g-t] lib/i915: Restore hangcheck modparams between tests
Related show

Commit Message

Chris Wilson May 26, 2020, 1:25 p.m. UTC
The hangcheck/reset modparam has far reaching effects and disables
functionality if switch off. This can surprise a few tests causing them
to skip.

References: https://gitlab.freedesktop.org/drm/intel/-/issues/1929
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/i915/gem.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch
diff mbox series

diff --git a/lib/i915/gem.c b/lib/i915/gem.c
index 3ef31ed33..45db8a0fd 100644
--- a/lib/i915/gem.c
+++ b/lib/i915/gem.c
@@ -130,6 +130,13 @@  static void reset_device(int i915)
 	close(dir);
 }
 
+static void restore_params(int i915)
+{
+	/* Re-enable modparams if left clobbered */
+	igt_params_set(i915, "reset", "%u", -1);
+	igt_params_set(i915, "enable_hangcheck", "%u", 1);
+}
+
 void igt_require_gem(int i915)
 {
 	int err;
@@ -150,6 +157,7 @@  void igt_require_gem(int i915)
 	 * sequences of batches.
 	 */
 	reset_device(i915);
+	restore_params(i915);
 	restore_defaults(i915);
 
 	err = 0;