summaryrefslogtreecommitdiff
path: root/kernel/rt.c
diff options
context:
space:
mode:
authorNicholas Mc Guire <der.herr@hofr.at>2013-11-22 03:52:30 (GMT)
committerScott Wood <scottwood@freescale.com>2014-05-14 18:38:25 (GMT)
commitaf2659f651918849544c9b6673def89a6c2d1347 (patch)
treec18d6f090586a789183f06f4719f97cd1dfc8b07 /kernel/rt.c
parentaf50a23755134451c53a7ab74edb15e0d619d0bc (diff)
downloadlinux-fsl-qoriq-af2659f651918849544c9b6673def89a6c2d1347.tar.xz
condition migration_disable on lock acquisition
No need to unconditionally migrate_disable (what is it protecting ?) and re-enable on failure to acquire the lock. This patch moves the migrate_disable to be conditioned on sucessful lock acquisition only. Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'kernel/rt.c')
-rw-r--r--kernel/rt.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/rt.c b/kernel/rt.c
index 92a16e1..ff56d3c 100644
--- a/kernel/rt.c
+++ b/kernel/rt.c
@@ -182,11 +182,10 @@ int __lockfunc rt_write_trylock(rwlock_t *rwlock)
{
int ret = rt_mutex_trylock(&rwlock->lock);
- migrate_disable();
- if (ret)
+ if (ret) {
rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_);
- else
- migrate_enable();
+ migrate_disable();
+ }
return ret;
}