[PATCH i-g-t 1/2] tests/device_reset: Wait for device nodes to re-appear

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Fri Jul 26 08:34:56 UTC 2024


CI sporadically reports the following issue:

(device_reset:1335) DEBUG: rebind the driver to the device
(device_reset:1335) DEBUG: reopen the device
(device_reset:1335) drmtest-DEBUG: Looking for devices to open using filter 0: sys:/sys/devices/pci0000:00/0000:00:02.0
(device_reset:1335) drmtest-DEBUG: Filter matched  | /dev/dri/renderD128
(device_reset:1335) drmtest-WARNING: No card matches the filter! [sys:/sys/devices/pci0000:00/0000:00:02.0]
(device_reset:1335) CRITICAL: Test assertion failure function healthcheck, file ../../../usr/src/igt-gpu-tools/tests/device_reset.c:393:
(device_reset:1335) CRITICAL: Failed assertion: dev->fds.dev >= 0
(device_reset:1335) CRITICAL: Last errno: 22, Invalid argument
(device_reset:1335) CRITICAL: file descriptor dev->fds.dev failed

After rebinding a DRM device driver, we now immediately start looking for
DRM devices that match our PCI filter established before unbind.  The
above messages indicate that occasionally not all device nodes are ready
by the time we are doing that.

Introduce a delay to give the kernel a chance to re-create in devtmpfs all
device nodes we are going to scan for.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11626
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
---
 tests/device_reset.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/device_reset.c b/tests/device_reset.c
index a669e1224e..8ed3ef5220 100644
--- a/tests/device_reset.c
+++ b/tests/device_reset.c
@@ -385,6 +385,8 @@ static bool is_i915_wedged(int i915)
 static void healthcheck(struct device_fds *dev)
 {
 	if (dev->fds.dev == -1) {
+		/* give the kernel a breath for re-creating device nodes in devtmpfs */
+		sleep(1);
 		/* refresh device list */
 		igt_devices_scan(true);
 		igt_debug("reopen the device\n");
-- 
2.45.2



More information about the igt-dev mailing list