[PATCH i-g-t v3 18/21] tests/core_hotunplug: Add 'lateclose before restore' variants
Janusz Krzysztofik
janusz.krzysztofik at linux.intel.com
Tue Aug 18 17:17:34 UTC 2020
If a GPU gets wedged during driver rebind or device re-plug for some
reason, current hotunbind/hotunplug test variants may time out before
lateclose phase, resulting in incomplete CI reports. Let's rename
those variants to more adequate hotrebind/hotreplug-lateclose and add
new variants focused on exercising the lateclose phase regardless of
potential rediscover/rebind issues under the old names.
v2: Rebase.
v3: Refresh.
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
---
tests/core_hotunplug.c | 50 +++++++++++++++++++++++++++++++++++++++---
1 file changed, 47 insertions(+), 3 deletions(-)
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index f00f9b114..9658c801f 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -368,8 +368,6 @@ static void hotunbind_lateclose(struct hotunplug *priv)
driver_unbind(priv, "hot ", 0);
- driver_bind(priv, 60);
-
igt_debug("late closing the unbound device instance\n");
igt_assert_eq(local_close_driver(priv->fd.drm, priv), -1);
}
@@ -380,7 +378,29 @@ static void hotunplug_lateclose(struct hotunplug *priv)
device_unplug(priv, "hot ", 0);
- bus_rescan(priv, 60);
+ igt_debug("late closing the removed device instance\n");
+ igt_assert_eq(local_close_driver(priv->fd.drm, priv), -1);
+}
+
+static void hotrebind_lateclose(struct hotunplug *priv)
+{
+ priv->fd.drm = local_drm_open_driver("", " for hotrebind");
+
+ driver_unbind(priv, "hot ", 60);
+
+ driver_bind(priv, 0);
+
+ igt_debug("late closing the unbound device instance\n");
+ igt_assert_eq(local_close_driver(priv->fd.drm, priv), -1);
+}
+
+static void hotreplug_lateclose(struct hotunplug *priv)
+{
+ priv->fd.drm = local_drm_open_driver("", " for hotreplug");
+
+ device_unplug(priv, "hot ", 60);
+
+ bus_rescan(priv, 0);
igt_debug("late closing the removed device instance\n");
igt_assert_eq(local_close_driver(priv->fd.drm, priv), -1);
@@ -460,6 +480,30 @@ igt_main
recover(&priv);
}
+ igt_fixture
+ post_healthcheck(&priv);
+
+ igt_subtest_group {
+ igt_describe("Check if the driver can be cleanly unbound from an open device and rebound back, then released");
+ igt_subtest("hotrebind-lateclose")
+ hotrebind_lateclose(&priv);
+
+ igt_fixture
+ recover(&priv);
+ }
+
+ igt_fixture
+ post_healthcheck(&priv);
+
+ igt_subtest_group {
+ igt_describe("Check if a still open device can be cleanly unplugged and rediscovered, then released");
+ igt_subtest("hotreplug-lateclose")
+ hotreplug_lateclose(&priv);
+
+ igt_fixture
+ recover(&priv);
+ }
+
igt_fixture {
post_healthcheck(&priv);
--
2.21.1
More information about the Intel-gfx-trybot
mailing list