[tip: timers/core] hrtimer: Add a lockdep assertion to hrtimer_update_base()

tip-bot2 for Thomas Weißschuh (Schneider Electric) posted 1 patch 1 month, 2 weeks ago
kernel/time/hrtimer.c | 2 ++
1 file changed, 2 insertions(+)
[tip: timers/core] hrtimer: Add a lockdep assertion to hrtimer_update_base()
Posted by tip-bot2 for Thomas Weißschuh (Schneider Electric) 1 month, 2 weeks ago
The following commit has been merged into the timers/core branch of tip:

Commit-ID:     d2e6ee3ecb76464e7146c1b4774383fee4b48146
Gitweb:        https://git.kernel.org/tip/d2e6ee3ecb76464e7146c1b4774383fee4b48146
Author:        Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
AuthorDate:    Mon, 03 Aug 2026 12:04:34 +02:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Tue, 11 Aug 2026 18:11:20 +02:00

hrtimer: Add a lockdep assertion to hrtimer_update_base()

Document and verify that the hrtimer_cpu_base::lock is held at this point.

Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Link: https://patch.msgid.link/20260803-auxclock-nanosleep-prep-v2-3-910cbd485390@linutronix.de
---
 kernel/time/hrtimer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 540561d..530d612 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -677,6 +677,8 @@ static ktime_t hrtimer_update_next_event(struct hrtimer_cpu_base *cpu_base)
 
 static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
 {
+	lockdep_assert_held(&base->lock);
+
 	ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset;
 	ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset;
 	ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset;