aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/ucm.h
diff options
context:
space:
mode:
authorSean Hefty <sean.hefty@intel.com>2005-08-19 13:46:34 -0700
committerRoland Dreier <rolandd@cisco.com>2005-08-26 20:37:38 -0700
commitb9ef520f9caf20aba8ac7cb2bbba45b52ff19d53 (patch)
treeb5e81a95dc8a9a099b85af13c476bf35d49ba56c /drivers/infiniband/core/ucm.h
parent[PATCH] IPoIB: Set full membership bit in P_Keys (diff)
downloadlinux-dev-b9ef520f9caf20aba8ac7cb2bbba45b52ff19d53.tar.xz
linux-dev-b9ef520f9caf20aba8ac7cb2bbba45b52ff19d53.zip
[PATCH] IB: fix userspace CM deadlock
Fix deadlock condition resulting from trying to destroy a cm_id from the context of a CM thread. The synchronization around the ucm context structure is simplified as a result, and some simple code cleanup is included. Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/core/ucm.h')
-rw-r--r--drivers/infiniband/core/ucm.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/infiniband/core/ucm.h b/drivers/infiniband/core/ucm.h
index 6d36606151b2..039e8a3783c0 100644
--- a/drivers/infiniband/core/ucm.h
+++ b/drivers/infiniband/core/ucm.h
@@ -48,9 +48,7 @@
struct ib_ucm_file {
struct semaphore mutex;
struct file *filp;
- /*
- * list of pending events
- */
+
struct list_head ctxs; /* list of active connections */
struct list_head events; /* list of pending events */
wait_queue_head_t poll_wait;
@@ -58,12 +56,11 @@ struct ib_ucm_file {
struct ib_ucm_context {
int id;
- int ref;
- int error;
+ wait_queue_head_t wait;
+ atomic_t ref;
struct ib_ucm_file *file;
struct ib_cm_id *cm_id;
- struct semaphore mutex;
struct list_head events; /* list of pending events. */
struct list_head file_list; /* member in file ctx list */