]> git.baikalelectronics.ru Git - kernel.git/commit
[IB] umad: avoid potential deadlock when unregistering MAD agents
authorRoland Dreier <rolandd@cisco.com>
Mon, 7 Nov 2005 18:41:29 +0000 (10:41 -0800)
committerRoland Dreier <rolandd@cisco.com>
Thu, 10 Nov 2005 18:22:50 +0000 (10:22 -0800)
commitab56ffb96694fa3f015ad3b8c1ed0934829ef877
treee6df3542a0a9dd36a8fa9939cdaeedf90f4884a5
parent1756c1c6aa953222fc96c4cb5e3266c1e4f01aea
[IB] umad: avoid potential deadlock when unregistering MAD agents

ib_unregister_mad_agent() completes all pending MAD sends and waits
for the agent's send_handler routine to return.  umad's send_handler()
calls queue_packet(), which does down_read() on the port mutex to look
up the agent ID.  This means that the port mutex cannot be held for
writing while calling ib_unregister_mad_agent(), or else it will
deadlock.  This patch fixes all the calls to ib_unregister_mad_agent()
in the umad module to avoid this deadlock.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/core/user_mad.c