Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4c3f279 authored by Don Wood's avatar Don Wood Committed by Roland Dreier
Browse files

RDMA/nes: Update refcnt during disconnect



During termination, it is possible for the refcnt to go to zero while
the worker thread is posting events upward.  This fix increments the
refcnt before the request is passed to the worker thread.  The thread
decrements the refcnt when the request is completed.

Signed-off-by: default avatarDon Wood <donald.e.wood@intel.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent e07cccf4
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -2456,6 +2456,7 @@ int nes_cm_disconn(struct nes_qp *nesqp)
	if (nesqp->disconn_pending == 0) {
	if (nesqp->disconn_pending == 0) {
		nesqp->disconn_pending++;
		nesqp->disconn_pending++;
		spin_unlock_irqrestore(&nesqp->lock, flags);
		spin_unlock_irqrestore(&nesqp->lock, flags);
		nes_add_ref(&nesqp->ibqp);
		/* init our disconnect work element, to */
		/* init our disconnect work element, to */
		INIT_WORK(&nesqp->disconn_work, nes_disconnect_worker);
		INIT_WORK(&nesqp->disconn_work, nes_disconnect_worker);


@@ -2477,6 +2478,7 @@ static void nes_disconnect_worker(struct work_struct *work)
	nes_debug(NES_DBG_CM, "processing AEQE id 0x%04X for QP%u.\n",
	nes_debug(NES_DBG_CM, "processing AEQE id 0x%04X for QP%u.\n",
			nesqp->last_aeq, nesqp->hwqp.qp_id);
			nesqp->last_aeq, nesqp->hwqp.qp_id);
	nes_cm_disconn_true(nesqp);
	nes_cm_disconn_true(nesqp);
	nes_rem_ref(&nesqp->ibqp);
}
}