Pull locking fixes from Ingo Molnar: "A paravirt UP-patching fix, and an I2C MUX driver lockdep warning fix" * 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: locking/pvqspinlock/x86: Use LOCK_PREFIX in __pv_queued_spin_unlock() assembly code i2c/mux, locking/core: Annotate the nested rt_mutex usage locking/rtmutex: Allow specifying a subclass for nested locking
Showing the changes to kernel (1 of 5 files). Show all
Unified · Split
| @@ -1465,6 +1465,29 @@ rt_mutex_fastunlock(struct rt_mutex *lock, · 1464 unmodified lines | |||
| 1465 | rt_mutex_postunlock(&wake_q); | 1465 | rt_mutex_postunlock(&wake_q); |
| 1466 | } | 1466 | } |
| 1467 | 1467 | ||
| 1468 | static inline void __rt_mutex_lock(struct rt_mutex *lock, unsigned int subclass) | ||
| 1469 | { | ||
| 1470 | might_sleep(); | ||
| 1471 | |||
| 1472 | mutex_acquire(&lock->dep_map, subclass, 0, _RET_IP_); | ||
| 1473 | rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock); | ||
| 1474 | } | ||
| 1475 | |||
| 1476 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 1477 | /** | ||
| 1478 | * rt_mutex_lock_nested - lock a rt_mutex | ||
| 1479 | * | ||
| 1480 | * @lock: the rt_mutex to be locked | ||
| 1481 | * @subclass: the lockdep subclass | ||
| 1482 | */ | ||
| 1483 | void __sched rt_mutex_lock_nested(struct rt_mutex *lock, unsigned int subclass) | ||
| 1484 | { | ||
| 1485 | __rt_mutex_lock(lock, subclass); | ||
| 1486 | } | ||
| 1487 | EXPORT_SYMBOL_GPL(rt_mutex_lock_nested); | ||
| 1488 | #endif | ||
| 1489 | |||
| 1490 | #ifndef CONFIG_DEBUG_LOCK_ALLOC | ||
| 1468 | /** | 1491 | /** |
| 1469 | * rt_mutex_lock - lock a rt_mutex | 1492 | * rt_mutex_lock - lock a rt_mutex |
| 1470 | * | 1493 | * |
| @@ -1472,12 +1495,10 @@ rt_mutex_fastunlock(struct rt_mutex *lock, · 1 unmodified line | |||
| 1472 | */ | 1495 | */ |
| 1473 | void __sched rt_mutex_lock(struct rt_mutex *lock) | 1496 | void __sched rt_mutex_lock(struct rt_mutex *lock) |
| 1474 | { | 1497 | { |
| 1475 | might_sleep(); | 1498 | __rt_mutex_lock(lock, 0); |
| 1476 | |||
| 1477 | mutex_acquire(&lock->dep_map, 0, 0, _RET_IP_); | ||
| 1478 | rt_mutex_fastlock(lock, TASK_UNINTERRUPTIBLE, rt_mutex_slowlock); | ||
| 1479 | } | 1499 | } |
| 1480 | EXPORT_SYMBOL_GPL(rt_mutex_lock); | 1500 | EXPORT_SYMBOL_GPL(rt_mutex_lock); |
| 1501 | #endif | ||
| 1481 | 1502 | ||
| 1482 | /** | 1503 | /** |
| 1483 | * rt_mutex_lock_interruptible - lock a rt_mutex interruptible | 1504 | * rt_mutex_lock_interruptible - lock a rt_mutex interruptible |