timers: Fix warning condition in __run_timers()
authorAnna-Maria Behnsen <anna-maria@linutronix.de>
Tue, 5 Apr 2022 19:17:32 +0000 (21:17 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 9 Apr 2022 20:17:47 +0000 (22:17 +0200)
commitc54bc0fc84214b203f7a0ebfd1bd308ce2abe920
tree073c27dcaaa24d211de3c0061d39d3f3e854fce5
parent3123109284176b1532874591f7c81f3837bbdc17
timers: Fix warning condition in __run_timers()

When the timer base is empty, base::next_expiry is set to base::clk +
NEXT_TIMER_MAX_DELTA and base::next_expiry_recalc is false. When no timer
is queued until jiffies reaches base::next_expiry value, the warning for
not finding any expired timer and base::next_expiry_recalc is false in
__run_timers() triggers.

To prevent triggering the warning in this valid scenario
base::timers_pending needs to be added to the warning condition.

Fixes: 31cd0e119d50 ("timers: Recalculate next timer interrupt only when necessary")
Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20220405191732.7438-3-anna-maria@linutronix.de
kernel/time/timer.c