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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
CC: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
CC: Jari Tahvanainen <jari.tahvanainen@xxxxxxxxx>
CC: Daniel Vetter <daniel@xxxxxxxx>
---

With this change, we can leave vgem_basic@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

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux