From: Stuart Summers <stuart.summers@intel.com>
Cc: igt-dev@lists.freedesktop.org, rodrigo.vivi@intel.com,
matthew.brost@intel.com, umesh.nerlige.ramappa@intel.com,
Michal.Wajdeczko@intel.com, matthew.d.roper@intel.com,
daniele.ceraolospurio@intel.com, shuicheng.lin@intel.com,
Stuart Summers <stuart.summers@intel.com>
Subject: [PATCH i-g-t 1/2] tests/intel/xe_configfs: Use the new debug configfs group
Date: Fri, 21 Aug 2026 19:23:32 +0000 [thread overview]
Message-ID: <20260821192332.19060-5-stuart.summers@intel.com> (raw)
In-Reply-To: <20260821192332.19060-4-stuart.summers@intel.com>
The xe driver moved its debug oriented configfs attributes
(ctx_restore_*_bb, engines_allowed, gt_types_allowed and
survivability_mode) into a "debug" subgroup of the device group. Open
that subgroup and use it for those attributes.
The subgroup only exists when the driver is built with
CONFIG_DRM_XE_DEBUG, so skip the subtests when it is missing rather
than failing on every attribute access.
Signed-off-by: Stuart Summers <stuart.summers@intel.com>
Assisted-by: Copilot:claude-opus-5
---
tests/intel/xe_configfs.c | 131 +++++++++++++++++++++++++-------------
1 file changed, 88 insertions(+), 43 deletions(-)
diff --git a/tests/intel/xe_configfs.c b/tests/intel/xe_configfs.c
index 450c0a119..c537e5d69 100644
--- a/tests/intel/xe_configfs.c
+++ b/tests/intel/xe_configfs.c
@@ -68,11 +68,26 @@ static void restore(int sig)
igt_kmod_bind("xe", bus_addr);
}
-static void set_survivability_mode(int configfs_device_fd, bool value)
+/*
+ * Debug oriented attributes live in the "debug" subgroup of the device
+ * group. The subgroup is only created when the driver is built with
+ * CONFIG_DRM_XE_DEBUG, so skip if it's not there.
+ */
+static int open_debug_group(int configfs_device_fd)
+{
+ int fd = openat(configfs_device_fd, "debug", O_RDONLY | O_DIRECTORY);
+
+ igt_require_f(fd >= 0,
+ "configfs debug group not available, is CONFIG_DRM_XE_DEBUG enabled?\n");
+
+ return fd;
+}
+
+static void set_survivability_mode(int configfs_debug_fd, bool value)
{
igt_audio_driver_unload(NULL);
igt_kmod_unbind("xe", bus_addr);
- igt_sysfs_set_boolean(configfs_device_fd, "survivability_mode", value);
+ igt_sysfs_set_boolean(configfs_debug_fd, "survivability_mode", value);
igt_kmod_bind("xe", bus_addr);
}
@@ -80,13 +95,13 @@ static void set_survivability_mode(int configfs_device_fd, bool value)
* SUBTEST: survivability-mode
* Description: Validate survivability mode by setting configfs
*/
-static void test_survivability_mode(int configfs_device_fd)
+static void test_survivability_mode(int configfs_debug_fd)
{
char path[PATH_MAX];
int fd;
/* Enable survivability mode */
- set_survivability_mode(configfs_device_fd, true);
+ set_survivability_mode(configfs_debug_fd, true);
/* check presence of survivability mode sysfs */
snprintf(path, PATH_MAX, "/sys/bus/pci/devices/%s/survivability_mode", bus_addr);
@@ -100,7 +115,7 @@ static void test_survivability_mode(int configfs_device_fd)
* SUBTEST: engines-allowed-invalid
* Description: Validate engines_allowed attribute for invalid values
*/
-static void test_engines_allowed_invalid(int configfs_device_fd)
+static void test_engines_allowed_invalid(int configfs_debug_fd)
{
static const char *values[] = {
"xcs0",
@@ -122,7 +137,7 @@ static void test_engines_allowed_invalid(int configfs_device_fd)
const char *v = values[i];
igt_debug("Writing '%s' to engines_allowed\n", v);
- igt_assert(!igt_sysfs_set(configfs_device_fd, "engines_allowed", v));
+ igt_assert(!igt_sysfs_set(configfs_debug_fd, "engines_allowed", v));
}
}
@@ -130,7 +145,7 @@ static void test_engines_allowed_invalid(int configfs_device_fd)
* SUBTEST: engines-allowed
* Description: Validate engines_allowed attribute
*/
-static void test_engines_allowed(int configfs_device_fd)
+static void test_engines_allowed(int configfs_debug_fd)
{
static const char *values[] = {
"rcs0", "rcs*", "rcs0,bcs0", "bcs0,rcs0",
@@ -149,7 +164,7 @@ static void test_engines_allowed(int configfs_device_fd)
const char *v = values[i];
igt_debug("Writing '%s' to engines_allowed\n", v);
- igt_assert(igt_sysfs_set(configfs_device_fd, "engines_allowed", v));
+ igt_assert(igt_sysfs_set(configfs_debug_fd, "engines_allowed", v));
}
}
@@ -157,7 +172,7 @@ static void test_engines_allowed(int configfs_device_fd)
* SUBTEST: gt-types-allowed
* Description: Validate gt_types_allowed attribute
*/
-static void test_gt_types_allowed(int configfs_device_fd)
+static void test_gt_types_allowed(int configfs_debug_fd)
{
static const char *values[] = {
"primary,media", "primary", "media", "",
@@ -180,14 +195,14 @@ static void test_gt_types_allowed(int configfs_device_fd)
const char *v = values[i];
igt_debug("Writing '%s' to gt_types_allowed\n", v);
- igt_assert(igt_sysfs_set(configfs_device_fd, "gt_types_allowed", v));
+ igt_assert(igt_sysfs_set(configfs_debug_fd, "gt_types_allowed", v));
}
for (size_t i = 0; i < ARRAY_SIZE(invalid_values); i++) {
const char *v = invalid_values[i];
igt_debug("Writing '%s' to gt_types_allowed\n", v);
- igt_assert(!igt_sysfs_set(configfs_device_fd, "gt_types_allowed", v));
+ igt_assert(!igt_sysfs_set(configfs_debug_fd, "gt_types_allowed", v));
}
}
@@ -198,7 +213,7 @@ static void test_gt_types_allowed(int configfs_device_fd)
* SUBTEST: ctx-restore-mid-bb-invalid
* Description: Validate ctx_restore_mid_bb attribute for invalid values
*/
-static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
+static void test_ctx_restore_invalid(int configfs_debug_fd, const char *type)
{
static const struct value {
const char *test;
@@ -234,7 +249,7 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
char file[64] = { };
snprintf(file, sizeof(file), "ctx_restore_%s_bb", type);
- igt_sysfs_set(configfs_device_fd, file, "");
+ igt_sysfs_set(configfs_debug_fd, file, "");
/*
* These only test if command parsing is correct,
@@ -248,8 +263,8 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
igt_info("Test %s\n", v->test);
igt_debug("bb '%s'\n", v->in);
- igt_assert(!igt_sysfs_set(configfs_device_fd, file, v->in));
- igt_assert(igt_sysfs_read(configfs_device_fd, file, buf,
+ igt_assert(!igt_sysfs_set(configfs_debug_fd, file, v->in));
+ igt_assert(igt_sysfs_read(configfs_debug_fd, file, buf,
sizeof(buf) - 1));
if (strcmp(buf, "")) {
igt_debug("Expecting empty bb, but found '%s'\n", buf);
@@ -265,7 +280,7 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
* SUBTEST: ctx-restore-mid-bb
* Description: Validate ctx_restore_mid_bb attribute
*/
-static void test_ctx_restore(int configfs_device_fd, const char *type,
+static void test_ctx_restore(int configfs_debug_fd, const char *type,
const char *engine)
{
static const struct value {
@@ -336,9 +351,9 @@ static void test_ctx_restore(int configfs_device_fd, const char *type,
igt_info("Test %s\n", v->test);
igt_debug("bb '%s'\n", in);
- igt_assert(igt_sysfs_set(configfs_device_fd, file, in));
+ igt_assert(igt_sysfs_set(configfs_debug_fd, file, in));
- igt_assert(igt_sysfs_read(configfs_device_fd, file, buf,
+ igt_assert(igt_sysfs_read(configfs_debug_fd, file, buf,
sizeof(buf) - 1));
if (strcmp(out, buf)) {
igt_debug("Expecting '%s' but found '%s'\n", out, buf);
@@ -368,15 +383,29 @@ static int create_device_configfs_group(int configfs_fd)
return configfs_device_fd;
}
+static void create_debug_configfs_group(int configfs_fd, int *configfs_device_fd,
+ int *configfs_debug_fd)
+{
+ *configfs_device_fd = create_device_configfs_group(configfs_fd);
+ *configfs_debug_fd = open_debug_group(*configfs_device_fd);
+}
+
static void close_configfs_group(int configfs_fd, int configfs_device_fd)
{
close(configfs_device_fd);
igt_fs_remove_dir(configfs_fd, bus_addr);
}
+static void close_debug_configfs_group(int configfs_fd, int configfs_device_fd,
+ int configfs_debug_fd)
+{
+ close(configfs_debug_fd);
+ close_configfs_group(configfs_fd, configfs_device_fd);
+}
+
int igt_main()
{
- int fd, configfs_fd, configfs_device_fd;
+ int fd, configfs_fd, configfs_device_fd, configfs_debug_fd;
bool is_vf_device;
bool has_survivability;
const char *engine = NULL;
@@ -412,62 +441,78 @@ int igt_main()
igt_subtest("survivability-mode") {
igt_require(has_survivability);
igt_require_f(!is_vf_device, "survivability mode not supported in VF\n");
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_survivability_mode(configfs_device_fd);
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_survivability_mode(configfs_debug_fd);
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_describe("Validate engines_allowed with invalid options");
igt_subtest("engines-allowed-invalid") {
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_engines_allowed_invalid(configfs_device_fd);
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_engines_allowed_invalid(configfs_debug_fd);
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_describe("Validate engines_allowed");
igt_subtest("engines-allowed") {
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_engines_allowed(configfs_device_fd);
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_engines_allowed(configfs_debug_fd);
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_describe("Validate gt_types_allowed");
igt_subtest("gt-types-allowed") {
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_gt_types_allowed(configfs_device_fd);
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_gt_types_allowed(configfs_debug_fd);
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_describe("Validate ctx_restore_post_bb with invalid options");
igt_subtest("ctx-restore-post-bb-invalid") {
igt_skip_on_f(is_vf_device, "MMIO register readback not possible on VF\n");
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_ctx_restore_invalid(configfs_device_fd, "post");
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_ctx_restore_invalid(configfs_debug_fd, "post");
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_describe("Validate ctx_restore_post_bb");
igt_subtest("ctx-restore-post-bb") {
igt_skip_on_f(is_vf_device, "MMIO register readback not possible on VF\n");
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_ctx_restore(configfs_device_fd, "post", engine);
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_ctx_restore(configfs_debug_fd, "post", engine);
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_describe("Validate ctx_restore_mid_bb with invalid options");
igt_subtest("ctx-restore-mid-bb-invalid") {
igt_skip_on_f(is_vf_device, "MMIO register readback not possible on VF\n");
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_ctx_restore_invalid(configfs_device_fd, "mid");
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_ctx_restore_invalid(configfs_debug_fd, "mid");
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_describe("Validate ctx_restore_mid_bb");
igt_subtest("ctx-restore-mid-bb") {
igt_skip_on_f(is_vf_device, "MMIO register readback not possible on VF\n");
- configfs_device_fd = create_device_configfs_group(configfs_fd);
- test_ctx_restore(configfs_device_fd, "mid", engine);
- close_configfs_group(configfs_fd, configfs_device_fd);
+ create_debug_configfs_group(configfs_fd, &configfs_device_fd,
+ &configfs_debug_fd);
+ test_ctx_restore(configfs_debug_fd, "mid", engine);
+ close_debug_configfs_group(configfs_fd, configfs_device_fd,
+ configfs_debug_fd);
}
igt_fixture() {
--
2.43.0
next prev parent reply other threads:[~2026-08-21 19:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 19:23 [PATCH i-g-t 0/2] Test new debug based configfs changes Stuart Summers
2026-08-21 19:23 ` Stuart Summers [this message]
2026-08-21 19:23 ` [PATCH i-g-t 2/2] tests/intel/xe_configfs: Add coverage for GuC log configfs entries Stuart Summers
2026-08-21 21:11 ` ✓ Xe.CI.BAT: success for Test new debug based configfs changes Patchwork
2026-08-21 21:26 ` ✓ i915.CI.BAT: " Patchwork
2026-08-21 23:19 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-08-22 0:16 ` ✗ i915.CI.Full: " Patchwork
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=20260821192332.19060-5-stuart.summers@intel.com \
--to=stuart.summers@intel.com \
--cc=Michal.Wajdeczko@intel.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
--cc=matthew.d.roper@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=shuicheng.lin@intel.com \
--cc=umesh.nerlige.ramappa@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.