aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2014-04-15 09:57:50 +0800
committerAlex Shi <alex.shi@linaro.org>2014-04-15 09:57:50 +0800
commitdc65fae3f730b6a1888f5559d68e59111f013c4f (patch)
tree019e33c310553116b5b64042820bfb007b0fa832 /kernel
parent5ad6d9ba813e2a36b624970f7e5beb4e12641bee (diff)
parentf512eefd5cde0ad21bd99bbfe4dc70b62805838e (diff)
Merge tag 'v3.10.37' into linux-linaro-lsk
This is the 3.10.37 stable release
Diffstat (limited to 'kernel')
-rw-r--r--kernel/futex.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index a283b3041072..3bc18bf48d0c 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -67,7 +67,9 @@
#include "rtmutex_common.h"
+#ifndef CONFIG_HAVE_FUTEX_CMPXCHG
int __read_mostly futex_cmpxchg_enabled;
+#endif
#define FUTEX_HASHBITS (CONFIG_BASE_SMALL ? 4 : 8)
@@ -2729,10 +2731,10 @@ SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
return do_futex(uaddr, op, val, tp, uaddr2, val2, val3);
}
-static int __init futex_init(void)
+static void __init futex_detect_cmpxchg(void)
{
+#ifndef CONFIG_HAVE_FUTEX_CMPXCHG
u32 curval;
- int i;
/*
* This will fail and we want it. Some arch implementations do
@@ -2746,6 +2748,14 @@ static int __init futex_init(void)
*/
if (cmpxchg_futex_value_locked(&curval, NULL, 0, 0) == -EFAULT)
futex_cmpxchg_enabled = 1;
+#endif
+}
+
+static int __init futex_init(void)
+{
+ int i;
+
+ futex_detect_cmpxchg();
for (i = 0; i < ARRAY_SIZE(futex_queues); i++) {
plist_head_init(&futex_queues[i].chain);