From: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>,
Jakub Kolakowski <jakub1.kolakowski@intel.com>,
Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>,
Lukasz Laguna <lukasz.laguna@intel.com>
Subject: [PATCH i-g-t] tests/core_hotunplug: Skip unplug when sysfs 'remove' is missing
Date: Tue, 3 Feb 2026 11:46:29 +0100 [thread overview]
Message-ID: <20260203104629.56005-1-marcin.bernatowicz@linux.intel.com> (raw)
Some PCI devices don't expose the sysfs remove attribute. The unplug/rescan
paths in core_hotunplug rely on writing 1 to remove, so attempting those
subtests would fail, skip the test early when remove is not present.
Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com>
Cc: Jakub Kolakowski <jakub1.kolakowski@intel.com>
Cc: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com>
Cc: Lukasz Laguna <lukasz.laguna@intel.com>
---
tests/core_hotunplug.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/tests/core_hotunplug.c b/tests/core_hotunplug.c
index e23b5b89f..7c9dae1bf 100644
--- a/tests/core_hotunplug.c
+++ b/tests/core_hotunplug.c
@@ -245,6 +245,17 @@ static void device_unplug(struct hotunplug *priv, const char *prefix,
{
igt_require(priv->fd.sysfs_dev == -1);
+ priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
+ O_DIRECTORY);
+ igt_assert_fd(priv->fd.sysfs_dev);
+
+ if (!igt_sysfs_has_attr(priv->fd.sysfs_dev, "remove")) {
+ priv->fd.sysfs_dev = close_sysfs(priv->fd.sysfs_dev);
+ igt_assert_eq(priv->fd.sysfs_dev, -1);
+ igt_skip("PCI %s has no sysfs 'remove' attribute, skipping test\n",
+ priv->dev_bus_addr);
+ }
+
/*
* FIXME: on some devices, the audio driver (snd_hda_intel)
* binds into the i915 driver. On such hardware, kernel warnings
@@ -254,16 +265,14 @@ static void device_unplug(struct hotunplug *priv, const char *prefix,
* unbind i915 driver, reloading it when binding again.
*/
if (igt_audio_driver_unload(&priv->snd_driver)) {
+ priv->fd.sysfs_dev = close_sysfs(priv->fd.sysfs_dev);
+ igt_assert_eq(priv->fd.sysfs_dev, -1);
igt_skip("Audio driver %s in use, skipping test\n",
priv->snd_driver);
} else if (priv->snd_driver) {
igt_info("Unloaded audio driver %s\n", priv->snd_driver);
}
- priv->fd.sysfs_dev = openat(priv->fd.sysfs_bus, priv->dev_bus_addr,
- O_DIRECTORY);
- igt_assert_fd(priv->fd.sysfs_dev);
-
local_debug("%sunplugging the device\n", prefix);
priv->failure = "Device unplug failure!";
--
2.43.0
next reply other threads:[~2026-02-03 10:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 10:46 Marcin Bernatowicz [this message]
2026-02-03 15:08 ` ✓ Xe.CI.BAT: success for tests/core_hotunplug: Skip unplug when sysfs 'remove' is missing Patchwork
2026-02-03 15:25 ` ✓ i915.CI.BAT: " Patchwork
2026-02-04 3:59 ` ✗ i915.CI.Full: failure " Patchwork
2026-02-04 5:16 ` ✗ Xe.CI.FULL: " Patchwork
2026-02-05 19:13 ` [PATCH i-g-t] " Kamil Konieczny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260203104629.56005-1-marcin.bernatowicz@linux.intel.com \
--to=marcin.bernatowicz@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jakub1.kolakowski@intel.com \
--cc=janusz.krzysztofik@linux.intel.com \
--cc=lukasz.laguna@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox