Commit e441d634 authored by Yannick Cote's avatar Yannick Cote Committed by Roland Dreier

IB/ipath: Fix hang on module unload

Handle the case where posting a send is requested when the link is
down.  This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1117>.
Signed-off-by: default avatarYannick Cote <yannick.cote@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 94035896
...@@ -340,9 +340,16 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr) ...@@ -340,9 +340,16 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
int acc; int acc;
int ret; int ret;
unsigned long flags; unsigned long flags;
struct ipath_devdata *dd = to_idev(qp->ibqp.device)->dd;
spin_lock_irqsave(&qp->s_lock, flags); spin_lock_irqsave(&qp->s_lock, flags);
if (qp->ibqp.qp_type != IB_QPT_SMI &&
!(dd->ipath_flags & IPATH_LINKACTIVE)) {
ret = -ENETDOWN;
goto bail;
}
/* Check that state is OK to post send. */ /* Check that state is OK to post send. */
if (unlikely(!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK))) if (unlikely(!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK)))
goto bail_inval; goto bail_inval;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment