IB/hfi1: Fix deadlock with txreq allocation slow path
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Sat, 18 Jun 2016 02:17:49 +0000 (19:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Aug 2016 07:33:17 +0000 (09:33 +0200)
commiteb860ec1a5c4e4cb6a6697cd50b7a6d84516cfd0
treee753da139b2803936df169d939ed2d5fcfced211
parent6ff49f18ef8203c03194f3cd39415a64195c3cb3
IB/hfi1: Fix deadlock with txreq allocation slow path

commit 2aee309d3e01447c55fdf89cef05a0e2be372655 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/hfi1/verbs_txreq.c
drivers/staging/rdma/hfi1/verbs_txreq.h