[PATCH] tests/device_reset: Require a PCI device

Rob Clark robdclark at gmail.com
Tue Aug 20 14:43:02 UTC 2024


From: Rob Clark <robdclark at chromium.org>

Too much baked in assumptions that the drm device is a PCI device.

Signed-off-by: Rob Clark <robdclark at chromium.org>
---
 tests/device_reset.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/device_reset.c b/tests/device_reset.c
index 8ed3ef5220fc..40681931c251 100644
--- a/tests/device_reset.c
+++ b/tests/device_reset.c
@@ -200,6 +200,17 @@ static void init_device_fds(struct device_fds *dev)
 		igt_require_gem(dev->fds.dev);
 
 	igt_assert(device_sysfs_path(dev->fds.dev, dev_path));
+
+	/*
+	 * Platform devices do not support reset at the bus level, as
+	 * there is no actual bus.
+	 *
+	 * For other bus types, other than PCI, whether and how bus
+	 * level reset is supported is left as an exercise for the
+	 * reader.
+	 */
+	igt_require(strstr(dev_path, "/sys/devices/pci") == dev_path);
+
 	addr_pos = strrchr(dev_path, '/');
 	igt_assert(addr_pos);
 	igt_assert_eq(sizeof(dev->dev_bus_addr) - 1,
-- 
2.46.0



More information about the igt-dev mailing list