[igt-dev] [PATCH i-g-t] lib/igt_aux/hang_detector: Don't enable reset if it's explicitly disabled

Arkadiusz Hiler arkadiusz.hiler at intel.com
Wed Jun 12 12:52:22 UTC 2019


We don't expect to hang during the tests using hang_detector, and the
only difference is more severe fallout in case a hang actually happens
and fewer surprised people seeing reset mysteriously enabled a couple of
tests down the line.

Cc: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala at intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
 lib/igt_aux.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 578f8579..af21fdac 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -514,8 +514,9 @@ void igt_fork_hang_detector(int fd)
 	 * 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 */));
+	if (igt_sysfs_get_u32(fd, "reset") != 0) /* if reset is not explicitly disabled */
+		igt_assert(igt_sysfs_set_parameter
+			   (fd, "reset", "%d", 1 /* only global reset */));
 
 	signal(SIGIO, sig_abort);
 	igt_fork_helper(&hang_detector)
-- 
2.21.0



More information about the igt-dev mailing list