diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-17 20:08:38 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:19:29 (GMT) |
commit | 3040e993d5358ce7362d791f465f0b0c42b5fb3a (patch) | |
tree | b7f1b2b7e31dc553769692b6129804c07a07bbad /include/linux | |
parent | 974238cc2d9ba6d79575f764bc76ccc7d2b63d27 (diff) | |
download | linux-fsl-qoriq-3040e993d5358ce7362d791f465f0b0c42b5fb3a.tar.xz |
timer-handle-idle-trylock-in-get-next-timer-irq.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/spinlock_rt.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/spinlock_rt.h b/include/linux/spinlock_rt.h index 621d857..447c457 100644 --- a/include/linux/spinlock_rt.h +++ b/include/linux/spinlock_rt.h @@ -50,7 +50,17 @@ extern void __lockfunc __rt_spin_unlock(struct rt_mutex *lock); #define spin_lock_irq(lock) spin_lock(lock) -#define spin_trylock(lock) __cond_lock(lock, rt_spin_trylock(lock)) +#define spin_do_trylock(lock) __cond_lock(lock, rt_spin_trylock(lock)) + +#define spin_trylock(lock) \ +({ \ + int __locked; \ + migrate_disable(); \ + __locked = spin_do_trylock(lock); \ + if (!__locked) \ + migrate_enable(); \ + __locked; \ +}) #ifdef CONFIG_LOCKDEP # define spin_lock_nested(lock, subclass) \ |