aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/spinlock_rt.h
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2024-08-12 12:39:02 +0200
committerThomas Gleixner <tglx@linutronix.de>2024-10-24 11:27:01 +0200
commit52e0874fc16bd26e9ea1871e30ffb2c6dff187cf (patch)
tree8443ea0757a21194752d396e3401b8d88b96de0f /include/linux/spinlock_rt.h
parentlocking/pvqspinlock: Convert fields of 'enum vcpu_state' to uppercase (diff)
downloadwireguard-linux-52e0874fc16bd26e9ea1871e30ffb2c6dff187cf.tar.xz
wireguard-linux-52e0874fc16bd26e9ea1871e30ffb2c6dff187cf.zip
locking/rt: Add sparse annotation PREEMPT_RT's sleeping locks.
The sleeping locks on PREEMPT_RT (rt_spin_lock() and friends) lack sparse annotation. Therefore a missing spin_unlock() won't be spotted by sparse in a PREEMPT_RT build while it is noticed on a !PREEMPT_RT build. Add the __acquires/__releases macros to the lock/ unlock functions. The trylock functions already use the __cond_lock() wrapper. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/20240812104200.2239232-2-bigeasy@linutronix.de
Diffstat (limited to 'include/linux/spinlock_rt.h')
-rw-r--r--include/linux/spinlock_rt.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h
index 61c49b16f69a..babc3e028779 100644
--- a/include/linux/spinlock_rt.h
+++ b/include/linux/spinlock_rt.h
@@ -32,10 +32,10 @@ do { \
__rt_spin_lock_init(slock, #slock, &__key, true); \
} while (0)
-extern void rt_spin_lock(spinlock_t *lock);
-extern void rt_spin_lock_nested(spinlock_t *lock, int subclass);
-extern void rt_spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *nest_lock);
-extern void rt_spin_unlock(spinlock_t *lock);
+extern void rt_spin_lock(spinlock_t *lock) __acquires(lock);
+extern void rt_spin_lock_nested(spinlock_t *lock, int subclass) __acquires(lock);
+extern void rt_spin_lock_nest_lock(spinlock_t *lock, struct lockdep_map *nest_lock) __acquires(lock);
+extern void rt_spin_unlock(spinlock_t *lock) __releases(lock);
extern void rt_spin_lock_unlock(spinlock_t *lock);
extern int rt_spin_trylock_bh(spinlock_t *lock);
extern int rt_spin_trylock(spinlock_t *lock);