From 92b24d6acbd663d7fc035f22c8fcdec6153c22c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20L=C3=B3pez?= Date: Wed, 9 Sep 2026 18:23:22 +0200 Subject: [PATCH] lib: test: disable TSA for spinlock tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spinlock tests deliberately use unconventional locking patterns to test edge cases. Disable thread safety analysis for them so that they don't generate false positives when the feature is enabled. Signed-off-by: Carlos López Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20260909162322.29778-15-carlos.lopezr4096@gmail.com Signed-off-by: Anup Patel --- lib/sbi/tests/riscv_locks_test.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/sbi/tests/riscv_locks_test.c b/lib/sbi/tests/riscv_locks_test.c index 7894c4e9..2cbba3da 100644 --- a/lib/sbi/tests/riscv_locks_test.c +++ b/lib/sbi/tests/riscv_locks_test.c @@ -4,6 +4,7 @@ static spinlock_t test_lock = SPIN_LOCK_INITIALIZER; static void spin_lock_test(struct sbiunit_test_case *test) + NO_THREAD_SAFETY_ANALYSIS { /* We don't want to accidentally get locked */ SBIUNIT_ASSERT(test, !spin_lock_check(&test_lock)); @@ -16,6 +17,7 @@ static void spin_lock_test(struct sbiunit_test_case *test) } static void spin_trylock_fail(struct sbiunit_test_case *test) + NO_THREAD_SAFETY_ANALYSIS { /* We don't want to accidentally get locked */ SBIUNIT_ASSERT(test, !spin_lock_check(&test_lock)); @@ -26,6 +28,7 @@ static void spin_trylock_fail(struct sbiunit_test_case *test) } static void spin_trylock_success(struct sbiunit_test_case *test) + NO_THREAD_SAFETY_ANALYSIS { SBIUNIT_EXPECT(test, spin_trylock(&test_lock)); spin_unlock(&test_lock);