summaryrefslogtreecommitdiff
path: root/kernel/futex.c
diff options
context:
space:
mode:
authorTrilok Soni <tsoni@codeaurora.org>2016-08-25 19:05:37 -0700
committerTrilok Soni <tsoni@codeaurora.org>2016-08-26 14:34:05 -0700
commit5ab1e18aa3913d454e1bd1498b20ee581aae2c6b (patch)
tree42bd10ef0bf5cdb8deb05656bf802c77dc580ff7 /kernel/futex.c
parente97b6a0e0217f7c072fdad6c50673cd7a64348e1 (diff)
Revert "Merge remote-tracking branch 'msm-4.4/tmp-510d0a3f' into msm-4.4"
This reverts commit 9d6fd2c3e9fcfb ("Merge remote-tracking branch 'msm-4.4/tmp-510d0a3f' into msm-4.4"), because it breaks the dump parsing tools due to kernel can be loaded anywhere in the memory now and not fixed at linear mapping. Change-Id: Id416f0a249d803442847d09ac47781147b0d0ee6 Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r--kernel/futex.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 9d8163afd87c..461c72b2dac2 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1244,20 +1244,10 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this,
if (unlikely(should_fail_futex(true)))
ret = -EFAULT;
- if (cmpxchg_futex_value_locked(&curval, uaddr, uval, newval)) {
+ if (cmpxchg_futex_value_locked(&curval, uaddr, uval, newval))
ret = -EFAULT;
- } else if (curval != uval) {
- /*
- * If a unconditional UNLOCK_PI operation (user space did not
- * try the TID->0 transition) raced with a waiter setting the
- * FUTEX_WAITERS flag between get_user() and locking the hash
- * bucket lock, retry the operation.
- */
- if ((FUTEX_TID_MASK & curval) == uval)
- ret = -EAGAIN;
- else
- ret = -EINVAL;
- }
+ else if (curval != uval)
+ ret = -EINVAL;
if (ret) {
raw_spin_unlock(&pi_state->pi_mutex.wait_lock);
return ret;
@@ -1484,8 +1474,8 @@ void requeue_futex(struct futex_q *q, struct futex_hash_bucket *hb1,
if (likely(&hb1->chain != &hb2->chain)) {
plist_del(&q->list, &hb1->chain);
hb_waiters_dec(hb1);
- hb_waiters_inc(hb2);
plist_add(&q->list, &hb2->chain);
+ hb_waiters_inc(hb2);
q->lock_ptr = &hb2->lock;
}
get_futex_key_refs(key2);
@@ -2548,15 +2538,6 @@ retry:
if (ret == -EFAULT)
goto pi_faulted;
/*
- * A unconditional UNLOCK_PI op raced against a waiter
- * setting the FUTEX_WAITERS bit. Try again.
- */
- if (ret == -EAGAIN) {
- spin_unlock(&hb->lock);
- put_futex_key(&key);
- goto retry;
- }
- /*
* wake_futex_pi has detected invalid state. Tell user
* space.
*/