linux-stable/drivers/android
Todd Kjos 9630fe8839 binder: introduce locking helper functions
There are 3 main spinlocks which must be acquired in this
order:
1) proc->outer_lock : protects most fields of binder_proc,
	binder_thread, and binder_ref structures. binder_proc_lock()
	and binder_proc_unlock() are used to acq/rel.
2) node->lock : protects most fields of binder_node.
	binder_node_lock() and binder_node_unlock() are
	used to acq/rel
3) proc->inner_lock : protects the thread and node lists
	(proc->threads, proc->nodes) and all todo lists associated
	with the binder_proc (proc->todo, thread->todo,
	proc->delivered_death and node->async_todo).
	binder_inner_proc_lock() and binder_inner_proc_unlock()
	are used to acq/rel

Any lock under procA must never be nested under any lock at the same
level or below on procB.

Functions that require a lock held on entry indicate which lock
in the suffix of the function name:

foo_olocked() : requires node->outer_lock
foo_nlocked() : requires node->lock
foo_ilocked() : requires proc->inner_lock
foo_iolocked(): requires proc->outer_lock and proc->inner_lock
foo_nilocked(): requires node->lock and proc->inner_lock

Signed-off-by: Todd Kjos <tkjos@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-17 14:48:23 +02:00
..
binder.c binder: introduce locking helper functions 2017-07-17 14:48:23 +02:00
binder_alloc.c binder: add more debug info when allocation fails. 2017-07-17 14:47:29 +02:00
binder_alloc.h binder: protect against two threads freeing buffer 2017-07-17 14:47:29 +02:00
binder_trace.h binder: refactor binder ref inc/dec for thread safety 2017-07-17 14:48:23 +02:00
Kconfig binder: Add 'hwbinder' to the default devices 2017-03-17 15:10:49 +09:00
Makefile binder: move binder_alloc to separate file 2017-07-17 14:47:29 +02:00