]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
timers: Add sparse annotation for timer_sync_wait_running().
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 12 Aug 2024 10:51:04 +0000 (12:51 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 14 Aug 2024 10:44:41 +0000 (12:44 +0200)
timer_sync_wait_running() first releases two locks and then acquires
them again. This is unexpected and sparse complains about it.

Add sparse annotation for timer_sync_wait_running() to note that the
locking is expected.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/all/20240812105326.2240000-2-bigeasy@linutronix.de
kernel/time/timer.c

index 64b0d8a0aa0f100270bc6824a6ede4b59fa6d537..429232d8659a361f629f441fff7a629bfa6e309e 100644 (file)
@@ -1561,6 +1561,8 @@ static inline void timer_base_unlock_expiry(struct timer_base *base)
  * the waiter to acquire the lock and make progress.
  */
 static void timer_sync_wait_running(struct timer_base *base)
+       __releases(&base->lock) __releases(&base->expiry_lock)
+       __acquires(&base->expiry_lock) __acquires(&base->lock)
 {
        if (atomic_read(&base->timer_waiters)) {
                raw_spin_unlock_irq(&base->lock);