aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2016-06-24 12:18:41 +0800
committerAlex Shi <alex.shi@linaro.org>2016-06-24 12:18:41 +0800
commitbbe8f0ee88a1eb4bb1e72e593b008faf387f30ac (patch)
tree83368f0950f7396944642057dd521044b696b7f5 /kernel
parent1beb6ea36b283c1dc34812c6ef9bf56a1e494f8c (diff)
parentd420f00c7bfb405884dd71fb7f87974f0d1be455 (diff)
Merge tag 'v3.18.36' into linux-linaro-lsk-v3.18lsk-v3.18-16.06
This is the 3.18.36 stable release
Diffstat (limited to 'kernel')
-rw-r--r--kernel/locking/mutex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c
index dadbf88c22c4..e3fe1dda72ca 100644
--- a/kernel/locking/mutex.c
+++ b/kernel/locking/mutex.c
@@ -471,9 +471,6 @@ __mutex_lock_check_stamp(struct mutex *lock, struct ww_acquire_ctx *ctx)
if (!hold_ctx)
return 0;
- if (unlikely(ctx == hold_ctx))
- return -EALREADY;
-
if (ctx->stamp - hold_ctx->stamp <= LONG_MAX &&
(ctx->stamp != hold_ctx->stamp || ctx > hold_ctx)) {
#ifdef CONFIG_DEBUG_MUTEXES
@@ -499,6 +496,12 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass,
unsigned long flags;
int ret;
+ if (use_ww_ctx) {
+ struct ww_mutex *ww = container_of(lock, struct ww_mutex, base);
+ if (unlikely(ww_ctx == READ_ONCE(ww->ctx)))
+ return -EALREADY;
+ }
+
preempt_disable();
mutex_acquire_nest(&lock->dep_map, subclass, 0, nest_lock, ip);