[PATCH i-g-t 1/3] tests/core_hotunplug: Add unbind-unplug-rescan variant
Janusz Krzysztofik
janusz.krzysztofik at linux.intel.com
Wed May 27 14:18:00 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 | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index e03f3b945..1429b9b6d 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -193,6 +193,29 @@ static void unbind_rebind(void)
healthcheck();
}
+static void unbind_unplug_rescan(void)
+{
+ struct hotunplug priv;
+ char buf[PATH_MAX];
+
+ prepare(&priv, buf, sizeof(buf));
+
+ 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;
@@ -279,6 +302,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