lib: sbi_fifo: add TSA annotations

Add Thread Safety Analysis (TSA) annotations for the FIFO
implementation. This consists of indicating which fields are protected
by a spinlock and annotating functionst that must be called under a
spinlock. sbi_fifo_init() must be excluded, as acquiring a spinlock
before it is initialized does not make sense.

Signed-off-by: Carlos López <carlos.lopezr4096@gmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260909162322.29778-5-carlos.lopezr4096@gmail.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Carlos López
2026-09-16 09:48:30 +05:30
committed by Anup Patel
parent b8f7e9ea80
commit 832ede6a8f
2 changed files with 11 additions and 6 deletions
+3 -3
View File
@@ -15,12 +15,12 @@
#include <sbi/sbi_types.h>
struct sbi_fifo {
void *queue;
spinlock_t qlock;
void *queue PT_GUARDED_BY(&qlock);
u16 entry_size;
u16 num_entries;
u16 avail;
u16 tail;
u16 avail GUARDED_BY(&qlock);
u16 tail GUARDED_BY(&qlock);
};
#define SBI_FIFO_INITIALIZER(__queue_mem, __entries, __entry_size) \