linux/drivers/infiniband/core
Roland Dreier 6b2eef8fd7 IB/mad: Fix possible lock-lock-timer deadlock
Lockdep reported a possible deadlock with cm_id_priv->lock,
mad_agent_priv->lock and mad_agent_priv->timed_work.timer; this
happens because the mad module does

	cancel_delayed_work(&mad_agent_priv->timed_work);

while holding mad_agent_priv->lock.  cancel_delayed_work() internally
does del_timer_sync(&mad_agent_priv->timed_work.timer).

This can turn into a deadlock because mad_agent_priv->lock is taken
inside cm_id_priv->lock, so we can get the following set of contexts
that deadlock each other:

 A: holding cm_id_priv->lock, waiting for mad_agent_priv->lock
 B: holding mad_agent_priv->lock, waiting for del_timer_sync()
 C: interrupt during mad_agent_priv->timed_work.timer that takes
    cm_id_priv->lock

Fix this by using the new __cancel_delayed_work() interface (which
internally does del_timer() instead of del_timer_sync()) in all the
places where we are holding a lock.

Addresses: http://bugzilla.kernel.org/show_bug.cgi?id=13757
Reported-by: Bart Van Assche <bart.vanassche@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
2009-09-07 08:27:50 -07:00
..
Makefile
addr.c RDMA: Add __init/__exit macros to addr.c and cma.c 2009-06-23 10:38:42 -07:00
agent.c
agent.h RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
cache.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
cm.c IB: Remove __constant_{endian} uses 2009-01-17 17:11:57 -08:00
cm_msgs.h IB: Remove __constant_{endian} uses 2009-01-17 17:11:57 -08:00
cma.c RDMA: Add __init/__exit macros to addr.c and cma.c 2009-06-23 10:38:42 -07:00
core_priv.h RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
device.c IB: Remove sysfs files before unregistering device 2009-02-25 13:27:46 -08:00
fmr_pool.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
iwcm.c RDMA/iwcm: Remove IB_ACCESS_LOCAL_WRITE from remote QP attributes 2008-07-22 14:18:34 -07:00
iwcm.h
mad.c IB/mad: Fix possible lock-lock-timer deadlock 2009-09-07 08:27:50 -07:00
mad_priv.h RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
mad_rmpp.c IB: Remove __constant_{endian} uses 2009-01-17 17:11:57 -08:00
mad_rmpp.h RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
multicast.c IB/multicast: Report errors on multicast groups if P_key changes 2008-01-25 14:15:29 -08:00
packer.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
sa.h
sa_query.c IB/sa_query: Fix AH leak due to update_sm_ah() race 2009-03-03 14:30:01 -08:00
smi.c IB/mad: Check hop count field in directed route MAD to avoid array overflow 2009-09-05 20:24:10 -07:00
smi.h IB/mad: Enable loopback of DR SMP responses from userspace 2008-01-25 14:15:25 -08:00
sysfs.c infiniband: remove driver_data direct access of struct device 2009-06-15 21:30:26 -07:00
ucm.c infiniband: struct device - replace bus_id with dev_name(), dev_set_name() 2009-01-06 10:44:39 -08:00
ucma.c RDMA/ucma: Test ucma_alloc_multicast() return against NULL, not with IS_ERR() 2008-10-10 12:00:19 -07:00
ud_header.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
umem.c RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
user_mad.c device create: infiniband: convert device_create_drvdata to device_create 2008-10-16 09:24:42 -07:00
uverbs.h RDMA: Remove subversion $Id tags 2008-07-14 23:48:44 -07:00
uverbs_cmd.c RDMA/core: Add memory management extensions support 2008-07-14 23:48:45 -07:00
uverbs_main.c saner FASYNC handling on file close 2008-11-01 09:49:46 -07:00
uverbs_marshall.c
verbs.c IB/core: Reset to error QP state transition is not allowed 2008-07-14 23:48:46 -07:00