diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2022-11-23 21:18:42 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2022-11-24 15:09:11 +0100 |
commit | 168f6b6ffbeec0b9333f3582e4cf637300858db5 (patch) | |
tree | 1f79a7bbc955782256c32d25d1f071646b414d8f /kernel/time | |
parent | 14f043f1340bf30bc60af127bff39f55889fef26 (diff) |
timers: Use del_timer_sync() even on UP
del_timer_sync() is assumed to be pointless on uniprocessor systems and can
be mapped to del_timer() because in theory del_timer() can never be invoked
while the timer callback function is executed.
This is not entirely true because del_timer() can be invoked from interrupt
context and therefore hit in the middle of a running timer callback.
Contrary to that del_timer_sync() is not allowed to be invoked from
interrupt context unless the affected timer is marked with TIMER_IRQSAFE.
del_timer_sync() has proper checks in place to detect such a situation.
Give up on the UP optimization and make del_timer_sync() unconditionally
available.
Co-developed-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
Link: https://lore.kernel.org/all/20220407161745.7d6754b3@gandalf.local.home
Link: https://lore.kernel.org/all/20221110064101.429013735@goodmis.org
Link: https://lore.kernel.org/r/20221123201624.888306160@linutronix.de
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/timer.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c index ea0150c366fe..550f0df3a2aa 100644 --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -1396,7 +1396,6 @@ static inline void timer_sync_wait_running(struct timer_base *base) { } static inline void del_timer_wait_running(struct timer_list *timer) { } #endif -#if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT_RT) /** * del_timer_sync - Deactivate a timer and wait for the handler to finish. * @timer: The timer to be deactivated @@ -1477,7 +1476,6 @@ int del_timer_sync(struct timer_list *timer) return ret; } EXPORT_SYMBOL(del_timer_sync); -#endif static void call_timer_fn(struct timer_list *timer, void (*fn)(struct timer_list *), |