From 0ff41bb737b19142ee6988afcb335549f75f0551 Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Wed, 30 Mar 2016 01:08:08 +0000 Subject: [PATCH] Remove unnecessary dequeue_mutex (added in r294610) from the iWARP connection manager. Examining so_comp without synchronization with iw_so_event_handler is a harmless race. Submitted by: Krishnamraju Eraparaju @ Chelsio Reviewed by: Steve Wise @ Open Grid Computing Sponsored by: Chelsio Communications --- sys/ofed/drivers/infiniband/core/iwcm.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sys/ofed/drivers/infiniband/core/iwcm.c b/sys/ofed/drivers/infiniband/core/iwcm.c index a90f907cb45..7e275841682 100644 --- a/sys/ofed/drivers/infiniband/core/iwcm.c +++ b/sys/ofed/drivers/infiniband/core/iwcm.c @@ -79,7 +79,6 @@ struct iwcm_listen_work { static LIST_HEAD(listen_port_list); static DEFINE_MUTEX(listen_port_mutex); -static DEFINE_MUTEX(dequeue_mutex); struct listen_port_info { struct list_head list; @@ -455,7 +454,6 @@ iw_so_event_handler(struct work_struct *_work) kfree(work); return; } - mutex_lock(&dequeue_mutex); /* Dequeue & process all new 'so' connection requests for this cmid */ while ((so = dequeue_socket(work->cm_id->so)) != NULL) { @@ -475,7 +473,6 @@ iw_so_event_handler(struct work_struct *_work) } } err: - mutex_unlock(&dequeue_mutex); kfree(work); #endif return; @@ -487,7 +484,6 @@ iw_so_upcall(struct socket *parent_so, void *arg, int waitflag) struct socket *so; struct iw_cm_id *cm_id = arg; - mutex_lock(&dequeue_mutex); /* check whether iw_so_event_handler() already dequeued this 'so' */ so = TAILQ_FIRST(&parent_so->so_comp); if (!so) @@ -500,7 +496,6 @@ iw_so_upcall(struct socket *parent_so, void *arg, int waitflag) INIT_WORK(&work->work, iw_so_event_handler); queue_work(iwcm_wq, &work->work); - mutex_unlock(&dequeue_mutex); return SU_OK; }