diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2016-06-17 19:17:49 -0700 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-06-23 10:16:15 -0400 |
commit | 2aee309d3e01447c55fdf89cef05a0e2be372655 (patch) | |
tree | adafeb7a28dc479b08799923931f8490be15be8d /drivers/infiniband/hw/hfi1/verbs_txreq.h | |
parent | 34d351f8ddf6dee24d739c4b00a4404e48089a04 (diff) |
IB/hfi1: Fix deadlock with txreq allocation slow path
A failure in the get_txreq() inline will result in a
slow path retry using __get_txreq().
__get_txreq() attempts to procure the qp s_lock, which
is already held in all callers.
Fix by deleting the s_lock maintenance in __get_txreq()
and add sparse syntax hooks to future proof the code.
Cc: Stable <stable@vger.kernel.org> # 4.6+
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/verbs_txreq.h')
-rw-r--r-- | drivers/infiniband/hw/hfi1/verbs_txreq.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/hfi1/verbs_txreq.h b/drivers/infiniband/hw/hfi1/verbs_txreq.h index 1cf69b2fe4a5..a1d6e0807f97 100644 --- a/drivers/infiniband/hw/hfi1/verbs_txreq.h +++ b/drivers/infiniband/hw/hfi1/verbs_txreq.h @@ -73,6 +73,7 @@ struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev, static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, struct rvt_qp *qp) + __must_hold(&qp->slock) { struct verbs_txreq *tx; struct hfi1_qp_priv *priv = qp->priv; |