]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.fixes/ib-ipath-fix-hang-on-module-unload
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.fixes / ib-ipath-fix-hang-on-module-unload
CommitLineData
2cb7cef9
BS
1From: Yannick Cote <yannick.cote@qlogic.com>
2Date: Tue, 30 Sep 2008 04:24:04 +0000 (-0700)
3Subject: IB/ipath: Fix hang on module unload
4Patch-mainline: 2.6.28-rc1
5Git-commit: e441d6342890838bfc6d64ca2f0964aca08ae2a2
6References: bnc#495068
7
8IB/ipath: Fix hang on module unload
9
10Handle the case where posting a send is requested when the link is
11down. This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1117>.
12
13Signed-off-by: Yannick Cote <yannick.cote@qlogic.com>
14Signed-off-by: Roland Dreier <rolandd@cisco.com>
15Acked-by: Jeff Mahoney <jeffm@suse.com>
16---
17
18 drivers/infiniband/hw/ipath/ipath_verbs.c | 7 +++++++
19 1 file changed, 7 insertions(+)
20
21diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
22index b766e40..eabc424 100644
23--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
24+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
25@@ -340,9 +340,16 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
26 int acc;
27 int ret;
28 unsigned long flags;
29+ struct ipath_devdata *dd = to_idev(qp->ibqp.device)->dd;
30
31 spin_lock_irqsave(&qp->s_lock, flags);
32
33+ if (qp->ibqp.qp_type != IB_QPT_SMI &&
34+ !(dd->ipath_flags & IPATH_LINKACTIVE)) {
35+ ret = -ENETDOWN;
36+ goto bail;
37+ }
38+
39 /* Check that state is OK to post send. */
40 if (unlikely(!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK)))
41 goto bail_inval;