Skip to contentSkip to conversation

IB/hfi1: More fixes for 4.7 rc

PATCH In review Dennis Dalessandro 3 participants 4 messages Jun 18, 2016 – Jun 23, 2016 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover IB/hfi1: More fixes for 4.7 rc

Doug, here are two more RC fixes that we would like to see landed in 4.7 if possible, including one which is marked as stable.

Patches apply on your k.o/for-4.7-rc tree ontop of the last batch of RC fixes which you just picked up.

Patches can also be viewed in my repo and have passed 0day builds:
https://github.com/ddalessa/kernel/tree/for-4.7

---

Ashutosh Dixit (1):

      IB/hfi1: Don't zero out qp->s_ack_queue in rvt_reset_qp

Mike Marciniszyn (1):
IB/hfi1: Fix deadlock with txreq allocation slow path

 drivers/infiniband/hw/hfi1/verbs_txreq.c |    4 +---
 drivers/infiniband/hw/hfi1/verbs_txreq.h |    1 +
 drivers/infiniband/sw/rdmavt/qp.c        |    6 ------
 3 files changed, 2 insertions(+), 9 deletions(-)

--
-Denny

A message that is not in the archive (sent off-list or not yet received): 20160618021550.31540.57897.stgit-9QXIwq+3FY+1XWohqUldA0EOCMrvLtNR@public.gmane.org

#2 lore raw

PATCH 1/2 IB/hfi1: Fix deadlock with txreq allocation slow path

From: Mike Marciniszyn <[email protected]>

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.

---
 drivers/infiniband/hw/hfi1/verbs_txreq.c |    4 +---
 drivers/infiniband/hw/hfi1/verbs_txreq.h |    1 +
 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hfi1/verbs_txreq.c +1 -3
index bc95c41..d8fb056 100644
@@ -92,11 +92,10 @@ void hfi1_put_txreq(struct verbs_txreq *tx)
 
 struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev,
 				struct rvt_qp *qp)
+	__must_hold(&qp->s_lock)
 {
 	struct verbs_txreq *tx = ERR_PTR(-EBUSY);
-	unsigned long flags;
 
-	spin_lock_irqsave(&qp->s_lock, flags);
 	write_seqlock(&dev->iowait_lock);
 	if (ib_rvt_state_ops[qp->state] & RVT_PROCESS_RECV_OK) {
 		struct hfi1_qp_priv *priv;
@@ -116,7 +115,6 @@ struct verbs_txreq *__get_txreq(struct hfi1_ibdev *dev,
 	}
 out:
 	write_sequnlock(&dev->iowait_lock);
-	spin_unlock_irqrestore(&qp->s_lock, flags);
 	return tx;
 }
 
drivers/infiniband/hw/hfi1/verbs_txreq.h +1 -0
index 1cf69b2..a1d6e08 100644
@@ -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;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH 2/2 IB/hfi1: Don't zero out qp->s_ack_queue in rvt_reset_qp

In reply to a message not in the archive

From: Ashutosh Dixit <[email protected]>

Since rvt_reset_qp already zero's out qp->s_ack_queue head and tail pointers, there is no need to zero out qp->s_ack_queue itself.

---
 drivers/infiniband/sw/rdmavt/qp.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
drivers/infiniband/sw/rdmavt/qp.c +0 -6
index c3e0d61..d04f4fe 100644
@@ -576,12 +576,6 @@ static void rvt_reset_qp(struct rvt_dev_info *rdi, struct rvt_qp *qp,
 	qp->s_ssn = 1;
 	qp->s_lsn = 0;
 	qp->s_mig_state = IB_MIG_MIGRATED;
-	if (qp->s_ack_queue)
-		memset(
-			qp->s_ack_queue,
-			0,
-			rvt_max_atomic(rdi) *
-				sizeof(*qp->s_ack_queue));
 	qp->r_head_ack_queue = 0;
 	qp->s_tail_ack_queue = 0;
 	qp->s_num_rd_atomic = 0;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to a message not in the archive
Quoted 18 lines · Dennis Dalessandro

Doug, here are two more RC fixes that we would like to see landed in 4.7 if possible, including one which is marked as stable.

Patches apply on your k.o/for-4.7-rc tree ontop of the last batch of RC fixes which you just picked up.

Patches can also be viewed in my repo and have passed 0day builds:
https://github.com/ddalessa/kernel/tree/for-4.7

---

Ashutosh Dixit (1):

      IB/hfi1: Don't zero out qp->s_ack_queue in rvt_reset_qp

Mike Marciniszyn (1):
IB/hfi1: Fix deadlock with txreq allocation slow path

Quoted 8 lines
 drivers/infiniband/hw/hfi1/verbs_txreq.c |    4 +---
 drivers/infiniband/hw/hfi1/verbs_txreq.h |    1 +
 drivers/infiniband/sw/rdmavt/qp.c        |    6 ------
 3 files changed, 2 insertions(+), 9 deletions(-)

--
-Denny

Hi Dennis, this series has been applied, thanks.

Signature · 2 lines
Doug Ledford <[email protected]>
              GPG KeyID: 0E572FDD