RDMA/cxgb4: Serialize calls to CQ's comp_handler
authorKumar Sanghvi <kumaras@chelsio.com>
Mon, 24 Oct 2011 15:50:21 +0000 (21:20 +0530)
committerRoland Dreier <roland@purestorage.com>
Mon, 31 Oct 2011 18:34:53 +0000 (11:34 -0700)
commit581bbe2cd0694a935e0c3ccd7f011e10094f1df6
tree38e536efa0d05d76964b09836def2210a00b41b5
parente14d62c05c0b8eff61c6fd46b4a78fb27c8cf38b
RDMA/cxgb4: Serialize calls to CQ's comp_handler

Commit 01e7da6ba53c ("RDMA/cxgb4: Make sure flush CQ entries are
collected on connection close") introduced a potential problem where a
CQ's comp_handler can get called simultaneously from different places
in the iw_cxgb4 driver.  This does not comply with
Documentation/infiniband/core_locking.txt, which states that at a
given point of time, there should be only one callback per CQ should
be active.

This problem was reported by Parav Pandit <Parav.Pandit@Emulex.Com>.
Based on discussion between Parav Pandit and Steve Wise, this patch
fixes the above problem by serializing the calls to a CQ's
comp_handler using a spin_lock.

Reported-by: Parav Pandit <Parav.Pandit@Emulex.Com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/cxgb4/cq.c
drivers/infiniband/hw/cxgb4/ev.c
drivers/infiniband/hw/cxgb4/iw_cxgb4.h
drivers/infiniband/hw/cxgb4/qp.c