aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-03-11 17:46:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-03-11 17:46:54 -0400
commit02bf0ef028b1ec4ae2ee2c0d8a009892a289e02d (patch)
tree0a01d8c0964470dd48044f50d88b5412a34e7a32
parentabeb75218aeb5d64e501a9434b81ef833d88c907 (diff)
parent6b0ef92fee2a3189eba6d6b827b247cb4f6da7e9 (diff)
Merge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Thomas Gleixner: "rt_mutex_futex_unlock() grew a new irq-off call site, but the function assumes that its always called from irq enabled context. Use (un)lock_irqsafe() to handle the new call site correctly" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: rtmutex: Make rt_mutex_futex_unlock() safe for irq-off callsites
-rw-r--r--kernel/locking/rtmutex.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c
index 65cc0cb984e6..940633c63254 100644
--- a/kernel/locking/rtmutex.c
+++ b/kernel/locking/rtmutex.c
@@ -1616,11 +1616,12 @@ bool __sched __rt_mutex_futex_unlock(struct rt_mutex *lock,
1616void __sched rt_mutex_futex_unlock(struct rt_mutex *lock) 1616void __sched rt_mutex_futex_unlock(struct rt_mutex *lock)
1617{ 1617{
1618 DEFINE_WAKE_Q(wake_q); 1618 DEFINE_WAKE_Q(wake_q);
1619 unsigned long flags;
1619 bool postunlock; 1620 bool postunlock;
1620 1621
1621 raw_spin_lock_irq(&lock->wait_lock); 1622 raw_spin_lock_irqsave(&lock->wait_lock, flags);
1622 postunlock = __rt_mutex_futex_unlock(lock, &wake_q); 1623 postunlock = __rt_mutex_futex_unlock(lock, &wake_q);
1623 raw_spin_unlock_irq(&lock->wait_lock); 1624 raw_spin_unlock_irqrestore(&lock->wait_lock, flags);
1624 1625
1625 if (postunlock) 1626 if (postunlock)
1626 rt_mutex_postunlock(&wake_q); 1627 rt_mutex_postunlock(&wake_q);