From 2d34c0e0e1fe205a60eb4185900c78b1844b2214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20L=C3=B3pez?= Date: Wed, 9 Sep 2026 18:23:14 +0200 Subject: [PATCH] lib: sbi_scratch: add TSA annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add Thread Safety Analysis (TSA) annotations for the scratch space implementation. This only consists of annotating that the extra_offset global must be accessed under the extra_lock spinlock. Signed-off-by: Carlos López Reviewed-by: Anup Patel Link: https://lore.kernel.org/r/20260909162322.29778-7-carlos.lopezr4096@gmail.com Signed-off-by: Anup Patel --- lib/sbi/sbi_scratch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/sbi/sbi_scratch.c b/lib/sbi/sbi_scratch.c index bb14a1a2..21120b14 100644 --- a/lib/sbi/sbi_scratch.c +++ b/lib/sbi/sbi_scratch.c @@ -21,7 +21,8 @@ u32 hartindex_to_hartid_table[SBI_HARTMASK_MAX_BITS] = { [0 ... SBI_HARTMASK_MAX struct sbi_scratch *hartindex_to_scratch_table[SBI_HARTMASK_MAX_BITS]; static spinlock_t extra_lock = SPIN_LOCK_INITIALIZER; -static unsigned long extra_offset = SBI_SCRATCH_EXTRA_SPACE_OFFSET; +static unsigned long + extra_offset GUARDED_BY(&extra_lock) = SBI_SCRATCH_EXTRA_SPACE_OFFSET; /* * Get the alignment size.