linux/drivers/infiniband/ulp/ipoib
Yossi Etigin e8224e4b80 IPoIB: Fix deadlock on RTNL between bcast join comp and ipoib_stop()
Taking rtnl_lock in ipoib_mcast_join_complete() causes a deadlock with
ipoib_stop().  We avoid it by scheduling the piece of code that takes
the lock on ipoib_workqueue instead of executing it directly.  This
works because we only flush the ipoib_workqueue with the RTNL not held.

The deadlock happens because ipoib_stop() calls ipoib_ib_dev_down()
which calls ipoib_mcast_dev_flush(), which calls ipoib_mcast_free(),
which calls ipoib_mcast_leave(). The latter calls
ib_sa_free_multicast(), and this waits until the multicast completion
handler finishes.  This handler is ipoib_mcast_join_complete(), which
waits for the rtnl_lock(), which was already taken by ipoib_stop().

This bug was introduced in commit a77a57a1 ("IPoIB: Fix deadlock on
RTNL in ipoib_stop()").

Signed-off-by: Yossi Etigin <yosefe@voltaire.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2008-09-16 11:57:45 -07:00
..
ipoib_cm.c IPoIB/cm: Use vmalloc() to allocate rx_rings 2008-08-08 15:51:29 -07:00
ipoib_ethtool.c IPoIB: add LRO support 2008-07-14 23:48:48 -07:00
ipoib_fs.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
ipoib_ib.c IPoIB: Refresh paths instead of flushing them on SM change events 2008-07-14 23:48:49 -07:00
ipoib_main.c IPoIB: Fix deadlock on RTNL between bcast join comp and ipoib_stop() 2008-09-16 11:57:45 -07:00
ipoib_multicast.c IPoIB: Fix deadlock on RTNL between bcast join comp and ipoib_stop() 2008-09-16 11:57:45 -07:00
ipoib_verbs.c IPoIB: Get rid of ipoib_mcast_detach() wrapper 2008-07-14 23:48:50 -07:00
ipoib_vlan.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
ipoib.h IPoIB: Fix deadlock on RTNL between bcast join comp and ipoib_stop() 2008-09-16 11:57:45 -07:00
Kconfig IPoIB: Correct help text for INFINIBAND_IPOIB_DEBUG 2008-07-24 20:37:25 -07:00
Makefile IPoIB: Add basic ethtool support 2008-04-16 21:09:32 -07:00