summaryrefslogtreecommitdiff
path: root/kernel/time/alarmtimer.c
diff options
context:
space:
mode:
authorPrasad Sodagudi <psodagud@codeaurora.org>2018-09-24 16:25:55 -0700
committerGeorg Veichtlbauer <georg@vware.at>2023-07-16 12:47:42 +0200
commit400383059868487869772b1c68ab8db4b6c81cbb (patch)
tree41c06132b571bf7c58c392989f4be4c39cf49977 /kernel/time/alarmtimer.c
parent1daa7ea39076e334a07ffb90f55ae33398b3477f (diff)
kernel: time: Add delay after cpu_relax() in tight loops
Tight loops of spin_lock_irqsave() and spin_unlock_irqrestore() in timer and hrtimer are causing scheduling delays. Add delay of few nano seconds after cpu_relax in the timer/hrtimer tight loops. Change-Id: Iaa0ab92da93f7b245b1d922b6edca2bebdc0fbce Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Diffstat (limited to 'kernel/time/alarmtimer.c')
-rw-r--r--kernel/time/alarmtimer.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 4171fee2d4ec..612c97156df7 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -25,6 +25,7 @@
#include <linux/posix-timers.h>
#include <linux/workqueue.h>
#include <linux/freezer.h>
+#include <linux/delay.h>
#ifdef CONFIG_MSM_PM
#include "lpm-levels.h"
@@ -503,6 +504,7 @@ int alarm_cancel(struct alarm *alarm)
if (ret >= 0)
return ret;
cpu_relax();
+ ndelay(TIMER_LOCK_TIGHT_LOOP_DELAY_NS);
}
}
EXPORT_SYMBOL_GPL(alarm_cancel);