@@ -82,8 +82,8 @@ static void prepare(struct hotunplug *priv)
igt_assert_fd(priv->fd.sysfs_bus);
priv->fd.sysfs_dev = local_close(priv->fd.sysfs_dev);
- igt_assert_f(priv->fd.sysfs_dev == -1,
- "Device sysfs node close failed\n");
+ igt_warn_on_f(priv->fd.sysfs_dev != -1,
+ "Device sysfs node close failed\n");
}
/* Unbind the driver from the device */
@@ -113,6 +113,9 @@ static void driver_bind(struct hotunplug *priv)
/* Remove (virtually unplug) the device from its bus */
static void device_unplug(struct hotunplug *priv, const char *prefix)
{
+ igt_require_f(priv->fd.sysfs_dev == -1,
+ "Device sysfs node not closed properly\n");
+
priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
O_DIRECTORY);
igt_assert_fd(priv->fd.sysfs_dev);
@@ -171,8 +174,6 @@ static void post_healthckeck(struct hotunplug *priv)
igt_abort_on_f(priv->failure, "%s\n", priv->failure);
igt_require_f(priv->fd.drm == -1, "Device not closed properly\n");
- igt_require_f(priv->fd.sysfs_dev == -1,
- "Device sysfs node not closed properly\n");
}
static void set_filter_from_device(int fd)
Since we no longer open a device DRM sysfs node, only a PCI one, driver unbind operations are no longer affected by missed or unsuccessful sysfs file close attempts. Skip only affected subtests if that happens. Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com> --- tests/core_hotunplug.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)