aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHariprasad S <hariprasad@chelsio.com>2014-12-17 03:41:03 -0500
committerRoland Dreier <roland@purestorage.com>2015-02-18 11:33:15 -0500
commit1fc8190dd66e280cfba8944506fe883a3ed86e57 (patch)
tree1fca0e4d6a3eaef75db04d09c6c22e6101b7c1d2
parentc62e68963106fb4d3f45e023e8ab21f1ad2d066e (diff)
RDMA/cxgb4: Don't hang threads forever waiting on WR replies
In c4iw_wait_for_reply(), if a FW6_MSG WR reply is not received after C4IW_WR_TO seconds, fail the WR operation and mark the device as fatally dead. Further, if the device is marked fatally dead, then fail the WR wait immediately. Also change the timeout to 60 seconds. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
-rw-r--r--drivers/infiniband/hw/cxgb4/iw_cxgb4.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index b5678ac97393..d87e1650f643 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -196,7 +196,7 @@ static inline int c4iw_num_stags(struct c4iw_rdev *rdev)
196 return (int)(rdev->lldi.vr->stag.size >> 5); 196 return (int)(rdev->lldi.vr->stag.size >> 5);
197} 197}
198 198
199#define C4IW_WR_TO (30*HZ) 199#define C4IW_WR_TO (60*HZ)
200 200
201struct c4iw_wr_wait { 201struct c4iw_wr_wait {
202 struct completion completion; 202 struct completion completion;
@@ -220,22 +220,21 @@ static inline int c4iw_wait_for_reply(struct c4iw_rdev *rdev,
220 u32 hwtid, u32 qpid, 220 u32 hwtid, u32 qpid,
221 const char *func) 221 const char *func)
222{ 222{
223 unsigned to = C4IW_WR_TO;
224 int ret; 223 int ret;
225 224
226 do { 225 if (c4iw_fatal_error(rdev)) {
227 ret = wait_for_completion_timeout(&wr_waitp->completion, to); 226 wr_waitp->ret = -EIO;
228 if (!ret) { 227 goto out;
229 printk(KERN_ERR MOD "%s - Device %s not responding - " 228 }
230 "tid %u qpid %u\n", func, 229
231 pci_name(rdev->lldi.pdev), hwtid, qpid); 230 ret = wait_for_completion_timeout(&wr_waitp->completion, C4IW_WR_TO);
232 if (c4iw_fatal_error(rdev)) { 231 if (!ret) {
233 wr_waitp->ret = -EIO; 232 PDBG("%s - Device %s not responding (disabling device) - tid %u qpid %u\n",
234 break; 233 func, pci_name(rdev->lldi.pdev), hwtid, qpid);
235 } 234 rdev->flags |= T4_FATAL_ERROR;
236 to = to << 2; 235 wr_waitp->ret = -EIO;
237 } 236 }
238 } while (!ret); 237out:
239 if (wr_waitp->ret) 238 if (wr_waitp->ret)
240 PDBG("%s: FW reply %d tid %u qpid %u\n", 239 PDBG("%s: FW reply %d tid %u qpid %u\n",
241 pci_name(rdev->lldi.pdev), wr_waitp->ret, hwtid, qpid); 240 pci_name(rdev->lldi.pdev), wr_waitp->ret, hwtid, qpid);