[2/2] lib: Add test child safe support to cancel work at exit

Submitted by Janusz Krzysztofik on June 7, 2019, 10:17 a.m.

Details

Message ID 20190607101703.31433-3-janusz.krzysztofik@linux.intel.com
State New
Headers show
Series "tests/gem_ringfill: Fix GPU wedged on test break" ( rev: 2 ) in IGT - Trybot

Not browsing as part of any series.

Commit Message

Janusz Krzysztofik June 7, 2019, 10:17 a.m.
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
---
 lib/drmtest.c | 6 ++++++
 1 file changed, 6 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 25f20353..106015d3 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -320,6 +320,11 @@  static int at_exit_drm_render_fd = -1;
 
 static void __cancel_work_at_exit(int fd)
 {
+	if (test_child) {
+		gem_quiescent_gpu(fd);
+		return;
+	}
+
 	igt_terminate_spins(); /* for older kernels */
 
 	igt_sysfs_set_parameter(fd, "reset", "%x", -1u /* any method */);
@@ -404,6 +409,7 @@  int drm_open_driver(int chipset)
 
 			at_exit_drm_fd = __drm_open_driver(chipset);
 			igt_install_exit_handler(cancel_work_at_exit);
+			igt_set_exit_handler_child_safe(cancel_work_at_exit);
 		}
 	}