[PATCH i-g-t 2/4] tests/core_hotunplug: Add unbind-unplug-rescan variant
Janusz Krzysztofik
janusz.krzysztofik at linux.intel.com
Sat Jun 6 17:51:03 UTC 2020
Check if this 3-step procedure also triggers DMAR faults.
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
---
tests/core_hotunplug.c | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 2192a1293..12084c333 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -204,6 +204,35 @@ static void unbind_rebind(void)
healthcheck();
}
+static void unbind_unplug_rescan(void)
+{
+ struct hotunplug priv;
+ char buf[PATH_MAX];
+
+ /* prepare for unbind */
+ prepare_for_rebind(&priv, buf, sizeof(buf));
+
+ /* also prepare for unplug */
+ igt_debug("closing the device\n");
+ close(priv.fd.drm);
+ prepare_for_rescan(&priv);
+
+ igt_debug("closing the device\n");
+ close(priv.fd.drm);
+
+ igt_debug("unbinding the driver from the device\n");
+ driver_unbind(priv.fd.sysfs_drv, priv.dev_bus_addr);
+ close(priv.fd.sysfs_drv);
+
+ igt_debug("unplugging the device\n");
+ device_unplug(priv.fd.sysfs_dev);
+
+ igt_debug("recovering the device\n");
+ bus_rescan(priv.fd.sysfs_bus);
+
+ healthcheck();
+}
+
static void unplug_rescan(void)
{
struct hotunplug priv;
@@ -290,6 +319,13 @@ igt_main
igt_fixture
igt_abort_on_f(failure, "%s\n", failure);
+ igt_describe("Check if closed driver can be unbound cleanly, device removed then recovered by rescan");
+ igt_subtest("unbind-unplug-rescan")
+ unbind_unplug_rescan();
+
+ igt_fixture
+ igt_abort_on_f(failure, "%s\n", failure);
+
igt_describe("Check if a device believed to be closed can be cleanly unplugged");
igt_subtest("unplug-rescan")
unplug_rescan();
--
2.21.1
More information about the Intel-gfx-trybot
mailing list