summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-07-17 20:08:38 (GMT)
committerScott Wood <scottwood@freescale.com>2013-04-04 22:09:27 (GMT)
commit841a7fefa879aa2c75e327f9f0931ba9eb3e9940 (patch)
tree458464848a1334689a75ae3bbdeecd968d3c1cca /kernel
parentb225e91e1ea601aa54a6220ec8bbe573b5e2540c (diff)
downloadlinux-fsl-qoriq-841a7fefa879aa2c75e327f9f0931ba9eb3e9940.tar.xz
timer-handle-idle-trylock-in-get-next-timer-irq.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rtmutex.c7
-rw-r--r--kernel/timer.c9
2 files changed, 8 insertions, 8 deletions
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index b562de3..3bff726 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -861,15 +861,10 @@ EXPORT_SYMBOL(rt_spin_unlock_wait);
int __lockfunc rt_spin_trylock(spinlock_t *lock)
{
- int ret;
+ int ret = rt_mutex_trylock(&lock->lock);
- migrate_disable();
- ret = rt_mutex_trylock(&lock->lock);
if (ret)
spin_acquire(&lock->dep_map, 0, 1, _RET_IP_);
- else
- migrate_enable();
-
return ret;
}
EXPORT_SYMBOL(rt_spin_trylock);
diff --git a/kernel/timer.c b/kernel/timer.c
index 5470c3e..8af44de 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1380,9 +1380,10 @@ unsigned long get_next_timer_interrupt(unsigned long now)
/*
* On PREEMPT_RT we cannot sleep here. If the trylock does not
* succeed then we return the worst-case 'expires in 1 tick'
- * value:
+ * value. We use the rt functions here directly to avoid a
+ * migrate_disable() call.
*/
- if (!spin_trylock(&base->lock))
+ if (!spin_do_trylock(&base->lock))
return now + 1;
#else
spin_lock(&base->lock);
@@ -1392,7 +1393,11 @@ unsigned long get_next_timer_interrupt(unsigned long now)
base->next_timer = __next_timer_interrupt(base);
expires = base->next_timer;
}
+#ifdef CONFIG_PREEMPT_RT_FULL
+ rt_spin_unlock(&base->lock);
+#else
spin_unlock(&base->lock);
+#endif
if (time_before_eq(expires, now))
return now;