[ofa-general] [PATCH] IB/ipath: ib_ipath module hangs on unload
yannick.cote at qlogic.com
yannick.cote at qlogic.com
Fri Sep 19 16:03:03 PDT 2008
This fix handles the case where posting a send is requested when the link
is down. This addresses bug #1117.
Signed-off-by: Yannick Cote <yannick.cote at qlogic.com>
---
Roland,
Please consider this for 2.6.27.
drivers/infiniband/hw/ipath/ipath_verbs.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
index b766e40..eabc424 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -340,9 +340,16 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
int acc;
int ret;
unsigned long flags;
+ struct ipath_devdata *dd = to_idev(qp->ibqp.device)->dd;
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. */
if (unlikely(!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK)))
goto bail_inval;
--
1.6.0.2
More information about the general
mailing list