[PATCH i-g-t 2/3] tests/core_hotunplug: Always check device health after late close

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Tue Sep 20 13:01:40 UTC 2022


Subtests hotrebind and hotreplug perform post-operation device healthcheck
while keeping an old instance of the device still open.  If that
healthcheck succeeds, the subtest returns success without closing that old
device instance.  Next, recover() function called from a follow-up
igt_fixture section only closes the old device, without re-checking if the
new device instance is healthy thereafter.  As a consequence, next tasks
may be executed in an insane environment.

Teach recover() to perform additional healthckech right after device close
if preceding subtest succeeded but left the device open.

Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
---
 tests/core_hotunplug.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index 68fd92238c..ebb646b50f 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -463,8 +463,13 @@ static void pre_check(struct hotunplug *priv)
 
 static void recover(struct hotunplug *priv)
 {
+	bool late_close = priv->fd.drm >= 0;
+
 	cleanup(priv);
 
+	if (!priv->failure && late_close)
+		igt_ignore_warn(healthcheck(priv, false));
+
 	/* unbind the driver from a possibly hot rebound unhealthy device */
 	if (!faccessat(priv->fd.sysfs_drv, priv->dev_bus_addr, F_OK, 0) &&
 	    priv->fd.drm == -1 && priv->fd.drm_hc == -1 && priv->failure)
-- 
2.25.1



More information about the Intel-gfx-trybot mailing list