]>
Commit | Line | Data |
---|---|---|
00e5a55c BS |
1 | From: Yannick Cote <yannick.cote@qlogic.com> |
2 | Date: Tue, 30 Sep 2008 04:24:04 +0000 (-0700) | |
3 | Subject: IB/ipath: Fix hang on module unload | |
4 | Patch-mainline: 2.6.28-rc1 | |
5 | Git-commit: e441d6342890838bfc6d64ca2f0964aca08ae2a2 | |
6 | References: bnc#495068 | |
7 | ||
8 | IB/ipath: Fix hang on module unload | |
9 | ||
10 | Handle the case where posting a send is requested when the link is | |
11 | down. This fixes <https://bugs.openfabrics.org/show_bug.cgi?id=1117>. | |
12 | ||
13 | Signed-off-by: Yannick Cote <yannick.cote@qlogic.com> | |
14 | Signed-off-by: Roland Dreier <rolandd@cisco.com> | |
15 | Acked-by: Jeff Mahoney <jeffm@suse.com> | |
16 | --- | |
17 | ||
18 | drivers/infiniband/hw/ipath/ipath_verbs.c | 7 +++++++ | |
19 | 1 file changed, 7 insertions(+) | |
20 | ||
21 | diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c | |
22 | index 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; |