]> git.openfabrics.org - ~emulex/infiniband.git/commit
firewire: remove global lock around address handlers, convert to RCU
authorPeter Hurley <peter@hurleysoftware.com>
Sun, 19 Aug 2012 06:50:02 +0000 (02:50 -0400)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Fri, 28 Sep 2012 09:47:41 +0000 (11:47 +0200)
commit35202f7d8420fff586b372422a2419affeaba8ef
tree617a3f8c13fa06e46432029ad172c172db8d4dd3
parent52439d605d6604c15954281a1d2831471dbd024c
firewire: remove global lock around address handlers, convert to RCU

Upper-layer handlers for inbound requests were called with a spinlock
held by firewire-core.  Calling into upper layers with a lower layer
lock held is generally a bad idea.

What's more, since commit ea102d0ec475 "firewire: core: convert AR-req
handler lock from _irqsave to _bh", a caller of fw_send_request() i.e.
initiator of outbound request could no longer do that while having
interrupts disabled, if the local node was addressed by that request.

In order to make all this more flexible, convert the management of
address ranges and handlers from a global lock around readers and
writers to RCU (and a remaining global lock for writers).  As a minor
side effect, handling of inbound requests at different cards and of
local requests is now no longer serialized.  (There is still per-card
serialization of remote requests since firewire-ohci uses a single DMA
tasklet for inbound request events.)

In other words, address handlers are now called in an RCU read-side
critical section instead of from within a spin_lock_bh serialized
section.

(Changelog rewritten by Stefan R.)

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/core-transaction.c