[PATCH v1 40/44] selftests: sdxi: exercise dataplane error paths

From: Wei Huang

Date: Thu Nov 19 2026 - 15:34:22 EST


Add SDXI driver error-path dataplane smoke test for 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/error.c | 24 ++++++++++++++++++++++++
3 files changed, 26 insertions(+), 1 deletion(-)
create mode 100644 tools/testing/selftests/sdxi/error.c

diff --git a/tools/testing/selftests/sdxi/.gitignore b/tools/testing/selftests/sdxi/.gitignore
index d05f961b1c67..d891f7a24c40 100644
--- a/tools/testing/selftests/sdxi/.gitignore
+++ b/tools/testing/selftests/sdxi/.gitignore
@@ -1,3 +1,4 @@
/context
/nop
/copy
+/error
diff --git a/tools/testing/selftests/sdxi/Makefile b/tools/testing/selftests/sdxi/Makefile
index 052b0a5fd194..c05390cb9d86 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 nop copy
+TEST_GEN_PROGS := context nop copy error

include ../lib.mk

diff --git a/tools/testing/selftests/sdxi/error.c b/tools/testing/selftests/sdxi/error.c
new file mode 100644
index 000000000000..b4be54722fba
--- /dev/null
+++ b/tools/testing/selftests/sdxi/error.c
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * SDXI error path selftests.
+ *
+ * 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, error)
+{
+ struct sdxi_desc d = sdxi_dsc_encode_rsvd();
+
+ // Attempt to make the error log wrap
+ for (size_t i = 0; i < 80; ++i)
+ EXPECT_EQ(sdxi_submit_oneshot(&d), 0);
+}
+
+TEST_HARNESS_MAIN
--
2.56.1