| .. | .. | 
|---|
| 14 | 14 |  #include <linux/export.h> | 
|---|
| 15 | 15 |   | 
|---|
| 16 | 16 |  void __raw_spin_lock_init(raw_spinlock_t *lock, const char *name, | 
|---|
| 17 |  | -			  struct lock_class_key *key)  | 
|---|
 | 17 | +			  struct lock_class_key *key, short inner)  | 
|---|
| 18 | 18 |  { | 
|---|
| 19 | 19 |  #ifdef CONFIG_DEBUG_LOCK_ALLOC | 
|---|
| 20 | 20 |  	/* | 
|---|
| 21 | 21 |  	 * Make sure we are not reinitializing a held lock: | 
|---|
| 22 | 22 |  	 */ | 
|---|
| 23 | 23 |  	debug_check_no_locks_freed((void *)lock, sizeof(*lock)); | 
|---|
| 24 |  | -	lockdep_init_map(&lock->dep_map, name, key, 0);  | 
|---|
 | 24 | +	lockdep_init_map_wait(&lock->dep_map, name, key, 0, inner);  | 
|---|
| 25 | 25 |  #endif | 
|---|
| 26 | 26 |  	lock->raw_lock = (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; | 
|---|
| 27 | 27 |  	lock->magic = SPINLOCK_MAGIC; | 
|---|
| .. | .. | 
|---|
| 31 | 31 |   | 
|---|
| 32 | 32 |  EXPORT_SYMBOL(__raw_spin_lock_init); | 
|---|
| 33 | 33 |   | 
|---|
| 34 |  | -#ifndef CONFIG_PREEMPT_RT_FULL  | 
|---|
 | 34 | +#ifndef CONFIG_PREEMPT_RT  | 
|---|
| 35 | 35 |  void __rwlock_init(rwlock_t *lock, const char *name, | 
|---|
| 36 | 36 |  		   struct lock_class_key *key) | 
|---|
| 37 | 37 |  { | 
|---|
| .. | .. | 
|---|
| 40 | 40 |  	 * Make sure we are not reinitializing a held lock: | 
|---|
| 41 | 41 |  	 */ | 
|---|
| 42 | 42 |  	debug_check_no_locks_freed((void *)lock, sizeof(*lock)); | 
|---|
| 43 |  | -	lockdep_init_map(&lock->dep_map, name, key, 0);  | 
|---|
 | 43 | +	lockdep_init_map_wait(&lock->dep_map, name, key, 0, LD_WAIT_CONFIG);  | 
|---|
| 44 | 44 |  #endif | 
|---|
| 45 | 45 |  	lock->raw_lock = (arch_rwlock_t) __ARCH_RW_LOCK_UNLOCKED; | 
|---|
| 46 | 46 |  	lock->magic = RWLOCK_MAGIC; | 
|---|
| .. | .. | 
|---|
| 113 | 113 |  { | 
|---|
| 114 | 114 |  	debug_spin_lock_before(lock); | 
|---|
| 115 | 115 |  	arch_spin_lock(&lock->raw_lock); | 
|---|
 | 116 | +	mmiowb_spin_lock();  | 
|---|
| 116 | 117 |  	debug_spin_lock_after(lock); | 
|---|
| 117 | 118 |  } | 
|---|
| 118 | 119 |   | 
|---|
| .. | .. | 
|---|
| 120 | 121 |  { | 
|---|
| 121 | 122 |  	int ret = arch_spin_trylock(&lock->raw_lock); | 
|---|
| 122 | 123 |   | 
|---|
| 123 |  | -	if (ret)  | 
|---|
 | 124 | +	if (ret) {  | 
|---|
 | 125 | +		mmiowb_spin_lock();  | 
|---|
| 124 | 126 |  		debug_spin_lock_after(lock); | 
|---|
 | 127 | +	}  | 
|---|
| 125 | 128 |  #ifndef CONFIG_SMP | 
|---|
| 126 | 129 |  	/* | 
|---|
| 127 | 130 |  	 * Must not happen on UP: | 
|---|
| .. | .. | 
|---|
| 133 | 136 |   | 
|---|
| 134 | 137 |  void do_raw_spin_unlock(raw_spinlock_t *lock) | 
|---|
| 135 | 138 |  { | 
|---|
 | 139 | +	mmiowb_spin_unlock();  | 
|---|
| 136 | 140 |  	debug_spin_unlock(lock); | 
|---|
| 137 | 141 |  	arch_spin_unlock(&lock->raw_lock); | 
|---|
| 138 | 142 |  } | 
|---|
| 139 | 143 |   | 
|---|
| 140 |  | -#ifndef CONFIG_PREEMPT_RT_FULL  | 
|---|
 | 144 | +#ifndef CONFIG_PREEMPT_RT  | 
|---|
| 141 | 145 |  static void rwlock_bug(rwlock_t *lock, const char *msg) | 
|---|
| 142 | 146 |  { | 
|---|
| 143 | 147 |  	if (!debug_locks_off()) | 
|---|