[Intel-gfx] [PATCH i-g-t] tests/vgem_basic: Retry the initial module unload in unload test

Petri Latvala petri.latvala at intel.com
Tue Oct 18 11:25:21 UTC 2016


If executed too soon after prime_vgem tests, the vgem unload test
fails due to its execbuffers still being handled in the kernel. Retry
the unload three times with sleeps before reporting a skip.

When tested on HSW, one 1s sleep wasn't enough, 3s was.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
CC: Chris Wilson <chris at chris-wilson.co.uk>
CC: Jari Tahvanainen <jari.tahvanainen at intel.com>
CC: Daniel Vetter <daniel at ffwll.ch>
---

With this change, we can leave vgem_basic at unload last in the CI
testlist, and thus still catch actual unload problems.

tests/vgem_basic.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c
index 5b54a4a..7f0750d 100644
--- a/tests/vgem_basic.c
+++ b/tests/vgem_basic.c
@@ -296,10 +296,15 @@ static int module_unload(void)
 static void test_unload(void)
 {
 	struct vgem_bo bo;
-	int vgem, dmabuf;
+	int vgem, dmabuf, unloaded, retry = 3;
 	uint32_t *ptr;
 
-	igt_require(module_unload() == 0);
+	while ((unloaded = module_unload()) && retry-- > 0) {
+		/* Sleep for a moment to let previous users finish */
+		sleep(1);
+	}
+
+	igt_require(unloaded == 0);
 
 	vgem = __drm_open_driver(DRIVER_VGEM);
 	igt_assert(vgem != -1);
-- 
2.9.3



More information about the Intel-gfx mailing list