diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2016-04-20 06:05:30 -0700 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-04-28 12:00:39 -0400 |
commit | b9b06cb6fedab10665a2d527464b45f332d17465 (patch) | |
tree | a4fd044efcf97647eefd215c660ae983348826fa | |
parent | e6d2e0176e1f3c1e1534851b66c0b972f03ff069 (diff) | |
download | linux-b9b06cb6fedab10665a2d527464b45f332d17465.tar.gz linux-b9b06cb6fedab10665a2d527464b45f332d17465.tar.bz2 linux-b9b06cb6fedab10665a2d527464b45f332d17465.zip |
IB/hfi1: Fix missing lock/unlock in verbs drain callback
The iowait_sdma_drained() callback lacked locking to
protect the qp s_flags field.
This causes the s_flags to be out of sync
on multiple CPUs, potentially corrupting the s_flags.
Fixes: a545f5308b6c ("staging/rdma/hfi: fix CQ completion order issue")
Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/staging/rdma/hfi1/qp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/rdma/hfi1/qp.c b/drivers/staging/rdma/hfi1/qp.c index 29a5ad28019b..dc9119e1b458 100644 --- a/drivers/staging/rdma/hfi1/qp.c +++ b/drivers/staging/rdma/hfi1/qp.c @@ -519,10 +519,12 @@ static void iowait_sdma_drained(struct iowait *wait) * do the flush work until that QP's * sdma work has finished. */ + spin_lock(&qp->s_lock); if (qp->s_flags & RVT_S_WAIT_DMA) { qp->s_flags &= ~RVT_S_WAIT_DMA; hfi1_schedule_send(qp); } + spin_unlock(&qp->s_lock); } /** |