X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=kernel%2Fmutex.c;h=6ca5fe96e393a5176428e95b34d6aa9fcc20de2b;hb=7961386fe9596e6bf03d09948a73c5df9653325b;hp=5d79781394a306e75048668262a6c3f49f5321ef;hpb=e0724bf6e4a1f2e678d2b2aab01cae22e17862f0;p=firefly-linux-kernel-4.4.55.git diff --git a/kernel/mutex.c b/kernel/mutex.c index 5d79781394a3..6ca5fe96e393 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c @@ -148,7 +148,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, preempt_disable(); mutex_acquire(&lock->dep_map, subclass, 0, ip); -#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) +#if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) && \ + !defined(CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES) /* * Optimistic spinning. * @@ -248,7 +249,9 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, /* didnt get the lock, go to sleep: */ spin_unlock_mutex(&lock->wait_lock, flags); - __schedule(); + preempt_enable_no_resched(); + schedule(); + preempt_disable(); spin_lock_mutex(&lock->wait_lock, flags); }