[PATCH v1 38/44] selftests: sdxi: test NOP descriptor submission
From: Wei Huang
Date: Thu Nov 19 2026 - 15:32:11 EST
Add a NOP descriptor submission and completion test to the SDXI
selftest suite.
Co-developed-by: Wei Huang <wei.huang2@xxxxxxx>
Signed-off-by: Wei Huang <wei.huang2@xxxxxxx>
Signed-off-by: Nathan Lynch <nathan.lynch@xxxxxxx>
---
tools/testing/selftests/sdxi/.gitignore | 1 +
tools/testing/selftests/sdxi/Makefile | 2 +-
tools/testing/selftests/sdxi/nop.c | 30 +++++++++++++++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
create mode 100644 tools/testing/selftests/sdxi/nop.c
diff --git a/tools/testing/selftests/sdxi/.gitignore b/tools/testing/selftests/sdxi/.gitignore
index 9e3f2c52330c..1127a33c0c5b 100644
--- a/tools/testing/selftests/sdxi/.gitignore
+++ b/tools/testing/selftests/sdxi/.gitignore
@@ -1 +1,2 @@
/context
+/nop
diff --git a/tools/testing/selftests/sdxi/Makefile b/tools/testing/selftests/sdxi/Makefile
index dba5d7df3872..8da832249c70 100644
--- a/tools/testing/selftests/sdxi/Makefile
+++ b/tools/testing/selftests/sdxi/Makefile
@@ -2,7 +2,7 @@ werror := -Werror
CFLAGS += -std=gnu17 -Og -Wall -Wextra $(werror) $(TOOLS_INCLUDES) $(KHDR_INCLUDES)
CPPFLAGS += -I../../../include/ -Ilib/
-TEST_GEN_PROGS := context
+TEST_GEN_PROGS := context nop
include ../lib.mk
diff --git a/tools/testing/selftests/sdxi/nop.c b/tools/testing/selftests/sdxi/nop.c
new file mode 100644
index 000000000000..fdddf28d269e
--- /dev/null
+++ b/tools/testing/selftests/sdxi/nop.c
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * SDXI NOP descriptor selftest.
+ *
+ * Copyright (C) 2026 Advanced Micro Devices, Inc.
+ */
+
+#include <stdlib.h>
+
+#include "lib/descriptor.h"
+#include "lib/fixture-context.h"
+#include "lib/lib.h"
+#include "../kselftest_harness.h"
+
+TEST_F(sdxi_context, nop)
+{
+ struct sdxi_desc d = sdxi_dsc_encode_nop();
+
+ EXPECT_EQ(sdxi_submit_sync(&self->context, &d), 0);
+}
+
+TEST_F(sdxi_context, nops_wrap)
+{
+ struct sdxi_desc d = sdxi_dsc_encode_nop();
+
+ for (size_t i = 0; i < self->context.n_entries * 2; ++i)
+ EXPECT_EQ(sdxi_submit_sync(&self->context, &d), 0);
+}
+
+TEST_HARNESS_MAIN
--
2.56.1