From: Anna-Maria Gleixner Date: Tue, 30 Jul 2019 22:33:49 +0000 (+0200) Subject: alarmtimer: Prepare for PREEMPT_RT X-Git-Tag: v5.15~5534^2~64 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51ae33092bb8320497ec75ddc5ab383d8fafd55c;p=platform%2Fkernel%2Flinux-starfive.git alarmtimer: Prepare for PREEMPT_RT Use the hrtimer_cancel_wait_running() synchronization mechanism to prevent priority inversion and live locks on PREEMPT_RT. [ tglx: Split out of combo patch ] Signed-off-by: Anna-Maria Gleixner Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lkml.kernel.org/r/20190730223828.508744705@linutronix.de --- diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 57518ef..3694744 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -432,7 +432,7 @@ int alarm_cancel(struct alarm *alarm) int ret = alarm_try_to_cancel(alarm); if (ret >= 0) return ret; - cpu_relax(); + hrtimer_cancel_wait_running(&alarm->timer); } } EXPORT_SYMBOL_GPL(alarm_cancel);