Staging: batman-adv: Limit spin_locks to spin_lock_bh
authorSven Eckelmann <sven.eckelmann@gmx.de>
Sun, 21 Nov 2010 23:56:01 +0000 (00:56 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 29 Nov 2010 19:09:13 +0000 (11:09 -0800)
commit7a18deb7b03e4112af5add8498889f9b2b36d59f
tree5981a5f191de7268371120a2b700bfcf8aa33809
parentbd204952cf161404eae0aa6478fb1b4c586ac678
Staging: batman-adv: Limit spin_locks to spin_lock_bh

spin_lock_irqsave disables the IRQs and stores them inside the flags
provided by the caller. This is needed to protect a bottom half handler
or a user context critical section from being interrupted by an
interrupt handler which also tries to acquire the spinlock and locks
forever.

The linux device drivers will receive the packets inside an interrupt
handler and the network infrastructure will process them inside bottom
half. Thus batman-adv will only run in user context and bottom half
handlers. We can conclude that batman-adv doesn't share its own
spinlocks with real interrupt handlers.

This makes it possible to exchange the quite complex spin_lock_irqsave
with spin_lock_bh which only stops bottom halves from running on the
current cpu, but allows interrupt handlers to take over to keep the
interrupt latency low.

Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/aggregation.c
drivers/staging/batman-adv/bat_debugfs.c
drivers/staging/batman-adv/icmp_socket.c
drivers/staging/batman-adv/originator.c
drivers/staging/batman-adv/routing.c
drivers/staging/batman-adv/send.c
drivers/staging/batman-adv/soft-interface.c
drivers/staging/batman-adv/translation-table.c
drivers/staging/batman-adv/unicast.c
drivers/staging/batman-adv/vis.c