summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorNicholas Mc Guire <der.herr@hofr.at>2013-11-22 03:52:30 (GMT)
committerScott Wood <scottwood@freescale.com>2015-02-13 22:20:44 (GMT)
commit6536b6b6ed300c7a36d761b37988d7a4314bde36 (patch)
tree22363fefa5e68dda28c3271ddd63a99271fadaa6 /kernel
parentad253470c91685c5d5b08cde47b6f1357ad56342 (diff)
downloadlinux-fsl-qoriq-6536b6b6ed300c7a36d761b37988d7a4314bde36.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')
-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;
}