Lines Matching +full:spin +full:- +full:up
1 // SPDX-License-Identifier: GPL-2.0-only
3 * PREEMPT_RT substitution for spin/rw_locks
8 * - Contrary to plain rtmutexes, spinlocks and rwlocks are state
11 * during that time are redirected to the saved state so no wake up is
14 * - Non RT spin/rwlocks disable preemption and eventually interrupts.
29 * preserving. Take RCU nesting into account as spin/read/write_lock() can
47 rtlock_lock(&lock->lock); in __rt_spin_lock()
54 spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); in rt_spin_lock()
62 spin_acquire(&lock->dep_map, subclass, 0, _RET_IP_); in rt_spin_lock_nested()
70 spin_acquire_nest(&lock->dep_map, 0, 0, nest_lock, _RET_IP_); in rt_spin_lock_nest_lock()
78 spin_release(&lock->dep_map, _RET_IP_); in rt_spin_unlock()
82 if (unlikely(!rt_mutex_cmpxchg_release(&lock->lock, current, NULL))) in rt_spin_unlock()
83 rt_mutex_slowunlock(&lock->lock); in rt_spin_unlock()
103 if (unlikely(!rt_mutex_cmpxchg_acquire(&lock->lock, NULL, current))) in __rt_spin_trylock()
104 ret = rt_mutex_slowtrylock(&lock->lock); in __rt_spin_trylock()
107 spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); in __rt_spin_trylock()
139 lockdep_init_map_type(&lock->dep_map, name, key, 0, LD_WAIT_CONFIG, in __rt_spin_lock_init()
146 * RT-specific reader/writer locks
198 ret = rwbase_read_trylock(&rwlock->rwbase); in rt_read_trylock()
200 rwlock_acquire_read(&rwlock->dep_map, 0, 1, _RET_IP_); in rt_read_trylock()
212 ret = rwbase_write_trylock(&rwlock->rwbase); in rt_write_trylock()
214 rwlock_acquire(&rwlock->dep_map, 0, 1, _RET_IP_); in rt_write_trylock()
225 rwlock_acquire_read(&rwlock->dep_map, 0, 0, _RET_IP_); in rt_read_lock()
226 rwbase_read_lock(&rwlock->rwbase, TASK_RTLOCK_WAIT); in rt_read_lock()
235 rwlock_acquire(&rwlock->dep_map, 0, 0, _RET_IP_); in rt_write_lock()
236 rwbase_write_lock(&rwlock->rwbase, TASK_RTLOCK_WAIT); in rt_write_lock()
246 rwlock_acquire(&rwlock->dep_map, subclass, 0, _RET_IP_); in rt_write_lock_nested()
247 rwbase_write_lock(&rwlock->rwbase, TASK_RTLOCK_WAIT); in rt_write_lock_nested()
256 rwlock_release(&rwlock->dep_map, _RET_IP_); in rt_read_unlock()
259 rwbase_read_unlock(&rwlock->rwbase, TASK_RTLOCK_WAIT); in rt_read_unlock()
265 rwlock_release(&rwlock->dep_map, _RET_IP_); in rt_write_unlock()
268 rwbase_write_unlock(&rwlock->rwbase); in rt_write_unlock()
277 lockdep_init_map_wait(&rwlock->dep_map, name, key, 0, LD_WAIT_CONFIG); in __rt_rwlock_init()