Lines Matching refs:lock
711 static void print_lockdep_cache(struct lockdep_map *lock) in print_lockdep_cache() argument
716 name = lock->name; in print_lockdep_cache()
718 name = __get_key_name(lock->key->subkeys, str); in print_lockdep_cache()
735 struct lock_class *lock = hlock_class(hlock); in print_lock() local
737 if (!lock) { in print_lock()
743 print_lock_name(lock); in print_lock()
844 look_up_lock_class(const struct lockdep_map *lock, unsigned int subclass) in look_up_lock_class() argument
866 if (unlikely(!lock->key)) in look_up_lock_class()
878 key = lock->key->subkeys + subclass; in look_up_lock_class()
894 WARN_ON_ONCE(class->name != lock->name && in look_up_lock_class()
895 lock->key != &__lockdep_no_validate__); in look_up_lock_class()
908 static bool assign_lock_key(struct lockdep_map *lock) in assign_lock_key() argument
910 unsigned long can_addr, addr = (unsigned long)lock; in assign_lock_key()
924 lock->key = (void *)can_addr; in assign_lock_key()
926 lock->key = (void *)can_addr; in assign_lock_key()
927 else if (static_obj(lock)) in assign_lock_key()
928 lock->key = (void *)lock; in assign_lock_key()
1235 register_lock_class(struct lockdep_map *lock, unsigned int subclass, int force) in register_lock_class() argument
1244 class = look_up_lock_class(lock, subclass); in register_lock_class()
1248 if (!lock->key) { in register_lock_class()
1249 if (!assign_lock_key(lock)) in register_lock_class()
1251 } else if (!static_obj(lock->key) && !is_dynamic_key(lock->key)) { in register_lock_class()
1255 key = lock->key->subkeys + subclass; in register_lock_class()
1288 class->name = lock->name; in register_lock_class()
1293 class->wait_type_inner = lock->wait_type_inner; in register_lock_class()
1294 class->wait_type_outer = lock->wait_type_outer; in register_lock_class()
1295 class->lock_type = lock->lock_type; in register_lock_class()
1328 lock->class_cache[0] = class; in register_lock_class()
1330 lock->class_cache[subclass] = class; in register_lock_class()
1456 struct lock_list * lock; in __cq_dequeue() local
1461 lock = cq->element[cq->front]; in __cq_dequeue()
1464 return lock; in __cq_dequeue()
1472 static inline void mark_lock_accessed(struct lock_list *lock) in mark_lock_accessed() argument
1474 lock->class->dep_gen_id = lockdep_dependency_gen_id; in mark_lock_accessed()
1477 static inline void visit_lock_entry(struct lock_list *lock, in visit_lock_entry() argument
1480 lock->parent = parent; in visit_lock_entry()
1483 static inline unsigned long lock_accessed(struct lock_list *lock) in lock_accessed() argument
1485 return lock->class->dep_gen_id == lockdep_dependency_gen_id; in lock_accessed()
1512 static inline struct list_head *get_dep_list(struct lock_list *lock, int offset) in get_dep_list() argument
1514 void *lock_class = lock->class; in get_dep_list()
1604 static inline void __bfs_init_root(struct lock_list *lock, in __bfs_init_root() argument
1607 lock->class = class; in __bfs_init_root()
1608 lock->parent = NULL; in __bfs_init_root()
1609 lock->only_xr = 0; in __bfs_init_root()
1620 static inline void bfs_init_root(struct lock_list *lock, in bfs_init_root() argument
1623 __bfs_init_root(lock, hlock_class(hlock)); in bfs_init_root()
1624 lock->only_xr = (hlock->read == 2); in bfs_init_root()
1634 static inline void bfs_init_rootb(struct lock_list *lock, in bfs_init_rootb() argument
1637 __bfs_init_root(lock, hlock_class(hlock)); in bfs_init_rootb()
1638 lock->only_xr = (hlock->read != 0); in bfs_init_rootb()
1641 static inline struct lock_list *__bfs_next(struct lock_list *lock, int offset) in __bfs_next() argument
1643 if (!lock || !lock->parent) in __bfs_next()
1646 return list_next_or_null_rcu(get_dep_list(lock->parent, offset), in __bfs_next()
1647 &lock->entry, struct lock_list, entry); in __bfs_next()
1684 struct lock_list *lock = NULL; in __bfs() local
1695 while ((lock = __bfs_next(lock, offset)) || (lock = __cq_dequeue(cq))) { in __bfs()
1696 if (!lock->class) in __bfs()
1708 if (lock_accessed(lock)) in __bfs()
1711 mark_lock_accessed(lock); in __bfs()
1717 if (lock->parent) { /* Parent exists, check prev dependency */ in __bfs()
1718 u8 dep = lock->dep; in __bfs()
1719 bool prev_only_xr = lock->parent->only_xr; in __bfs()
1734 lock->only_xr = !(dep & (DEP_SN_MASK | DEP_EN_MASK)); in __bfs()
1741 if (match(lock, data)) { in __bfs()
1742 *target_entry = lock; in __bfs()
1752 head = get_dep_list(lock, offset); in __bfs()
1754 visit_lock_entry(entry, lock); in __bfs()
3810 static void print_usage_bug_scenario(struct held_lock *lock) in print_usage_bug_scenario() argument
3812 struct lock_class *class = hlock_class(lock); in print_usage_bug_scenario()
4702 void lockdep_init_map_type(struct lockdep_map *lock, const char *name, in lockdep_init_map_type() argument
4709 lock->class_cache[i] = NULL; in lockdep_init_map_type()
4712 lock->cpu = raw_smp_processor_id(); in lockdep_init_map_type()
4719 lock->name = "NULL"; in lockdep_init_map_type()
4723 lock->name = name; in lockdep_init_map_type()
4725 lock->wait_type_outer = outer; in lockdep_init_map_type()
4726 lock->wait_type_inner = inner; in lockdep_init_map_type()
4727 lock->lock_type = lock_type; in lockdep_init_map_type()
4744 lock->key = key; in lockdep_init_map_type()
4757 register_lock_class(lock, subclass, 1); in lockdep_init_map_type()
4799 static int __lock_is_held(const struct lockdep_map *lock, int read);
4809 static int __lock_acquire(struct lockdep_map *lock, unsigned int subclass, in __lock_acquire() argument
4825 if (!prove_locking || lock->key == &__lockdep_no_validate__) in __lock_acquire()
4829 class = lock->class_cache[subclass]; in __lock_acquire()
4834 class = register_lock_class(lock, subclass, 0); in __lock_acquire()
4891 hlock->instance = lock; in __lock_acquire()
4985 struct lockdep_map *lock, in print_unlock_imbalance_bug() argument
5000 print_lockdep_cache(lock); in print_unlock_imbalance_bug()
5012 const struct lockdep_map *lock) in match_held_lock() argument
5014 if (hlock->instance == lock) in match_held_lock()
5018 const struct lock_class *class = lock->class_cache[0]; in match_held_lock()
5021 class = look_up_lock_class(lock, 0); in match_held_lock()
5049 struct lockdep_map *lock, in find_held_lock() argument
5058 if (match_held_lock(hlock, lock)) in find_held_lock()
5072 if (match_held_lock(hlock, lock)) { in find_held_lock()
5116 __lock_set_class(struct lockdep_map *lock, const char *name, in __lock_set_class() argument
5137 hlock = find_held_lock(curr, lock, depth, &i); in __lock_set_class()
5139 print_unlock_imbalance_bug(curr, lock, ip); in __lock_set_class()
5143 lockdep_init_map_type(lock, name, key, 0, in __lock_set_class()
5144 lock->wait_type_inner, in __lock_set_class()
5145 lock->wait_type_outer, in __lock_set_class()
5146 lock->lock_type); in __lock_set_class()
5147 class = register_lock_class(lock, subclass, 0); in __lock_set_class()
5165 static int __lock_downgrade(struct lockdep_map *lock, unsigned long ip) in __lock_downgrade() argument
5183 hlock = find_held_lock(curr, lock, depth, &i); in __lock_downgrade()
5185 print_unlock_imbalance_bug(curr, lock, ip); in __lock_downgrade()
5219 __lock_release(struct lockdep_map *lock, unsigned long ip) in __lock_release() argument
5235 print_unlock_imbalance_bug(curr, lock, ip); in __lock_release()
5243 hlock = find_held_lock(curr, lock, depth, &i); in __lock_release()
5245 print_unlock_imbalance_bug(curr, lock, ip); in __lock_release()
5249 if (hlock->instance == lock) in __lock_release()
5301 int __lock_is_held(const struct lockdep_map *lock, int read) in __lock_is_held() argument
5309 if (match_held_lock(hlock, lock)) { in __lock_is_held()
5320 static struct pin_cookie __lock_pin_lock(struct lockdep_map *lock) in __lock_pin_lock() argument
5332 if (match_held_lock(hlock, lock)) { in __lock_pin_lock()
5348 static void __lock_repin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in __lock_repin_lock() argument
5359 if (match_held_lock(hlock, lock)) { in __lock_repin_lock()
5368 static void __lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in __lock_unpin_lock() argument
5379 if (match_held_lock(hlock, lock)) { in __lock_unpin_lock()
5439 void lock_set_class(struct lockdep_map *lock, const char *name, in lock_set_class() argument
5451 if (__lock_set_class(lock, name, key, subclass, ip)) in lock_set_class()
5458 void lock_downgrade(struct lockdep_map *lock, unsigned long ip) in lock_downgrade() argument
5468 if (__lock_downgrade(lock, ip)) in lock_downgrade()
5476 static void verify_lock_unused(struct lockdep_map *lock, struct held_lock *hlock, int subclass) in verify_lock_unused() argument
5479 struct lock_class *class = look_up_lock_class(lock, subclass); in verify_lock_unused()
5531 void lock_acquire(struct lockdep_map *lock, unsigned int subclass, in lock_acquire() argument
5537 trace_lock_acquire(lock, subclass, trylock, read, check, nest_lock, ip); in lock_acquire()
5548 hlock.instance = lock; in lock_acquire()
5557 verify_lock_unused(lock, &hlock, subclass); in lock_acquire()
5566 __lock_acquire(lock, subclass, trylock, read, check, in lock_acquire()
5573 void lock_release(struct lockdep_map *lock, unsigned long ip) in lock_release() argument
5577 trace_lock_release(lock, ip); in lock_release()
5586 if (__lock_release(lock, ip)) in lock_release()
5593 noinstr int lock_is_held_type(const struct lockdep_map *lock, int read) in lock_is_held_type() argument
5605 ret = __lock_is_held(lock, read); in lock_is_held_type()
5614 struct pin_cookie lock_pin_lock(struct lockdep_map *lock) in lock_pin_lock() argument
5626 cookie = __lock_pin_lock(lock); in lock_pin_lock()
5634 void lock_repin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in lock_repin_lock() argument
5645 __lock_repin_lock(lock, cookie); in lock_repin_lock()
5651 void lock_unpin_lock(struct lockdep_map *lock, struct pin_cookie cookie) in lock_unpin_lock() argument
5662 __lock_unpin_lock(lock, cookie); in lock_unpin_lock()
5670 struct lockdep_map *lock, in print_lock_contention_bug() argument
5685 print_lockdep_cache(lock); in print_lock_contention_bug()
5697 __lock_contended(struct lockdep_map *lock, unsigned long ip) in __lock_contended() argument
5713 hlock = find_held_lock(curr, lock, depth, &i); in __lock_contended()
5715 print_lock_contention_bug(curr, lock, ip); in __lock_contended()
5719 if (hlock->instance != lock) in __lock_contended()
5726 lock->ip); in __lock_contended()
5733 if (lock->cpu != smp_processor_id()) in __lock_contended()
5738 __lock_acquired(struct lockdep_map *lock, unsigned long ip) in __lock_acquired() argument
5755 hlock = find_held_lock(curr, lock, depth, &i); in __lock_acquired()
5757 print_lock_contention_bug(curr, lock, _RET_IP_); in __lock_acquired()
5761 if (hlock->instance != lock) in __lock_acquired()
5778 if (lock->cpu != cpu) in __lock_acquired()
5781 lock->cpu = cpu; in __lock_acquired()
5782 lock->ip = ip; in __lock_acquired()
5785 void lock_contended(struct lockdep_map *lock, unsigned long ip) in lock_contended() argument
5789 trace_lock_contended(lock, ip); in lock_contended()
5797 __lock_contended(lock, ip); in lock_contended()
5803 void lock_acquired(struct lockdep_map *lock, unsigned long ip) in lock_acquired() argument
5807 trace_lock_acquired(lock, ip); in lock_acquired()
5815 __lock_acquired(lock, ip); in lock_acquired()
6124 static bool lock_class_cache_is_registered(struct lockdep_map *lock) in lock_class_cache_is_registered() argument
6134 if (lock->class_cache[j] == class) in lock_class_cache_is_registered()
6143 struct lockdep_map *lock) in __lockdep_reset_lock() argument
6155 class = look_up_lock_class(lock, j); in __lockdep_reset_lock()
6163 if (WARN_ON_ONCE(lock_class_cache_is_registered(lock))) in __lockdep_reset_lock()
6171 static void lockdep_reset_lock_reg(struct lockdep_map *lock) in lockdep_reset_lock_reg() argument
6183 __lockdep_reset_lock(pf, lock); in lockdep_reset_lock_reg()
6195 static void lockdep_reset_lock_imm(struct lockdep_map *lock) in lockdep_reset_lock_imm() argument
6202 __lockdep_reset_lock(pf, lock); in lockdep_reset_lock_imm()
6208 void lockdep_reset_lock(struct lockdep_map *lock) in lockdep_reset_lock() argument
6213 lockdep_reset_lock_imm(lock); in lockdep_reset_lock()
6215 lockdep_reset_lock_reg(lock); in lockdep_reset_lock()