aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSteve Wise <swise@opengridcomputing.com>2010-07-23 15:12:43 -0400
committerRoland Dreier <rolandd@cisco.com>2010-08-04 12:54:42 -0400
commita5f4a07820ebc60b21c984d893f48402c4b4a4a2 (patch)
tree08566f15e1a8b73a3f71a03234e015cf79d00470 /drivers/infiniband
parentca5a22028d0845dd6bcce0dce12a7beda315baf0 (diff)
RDMA/cxgb4: Add timeouts when waiting for FW responses
Don't hang a host thread if the FW stops responding. Signed-off-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 3eff5df6d40f..6c40779b62f4 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -2050,8 +2050,15 @@ int c4iw_create_listen(struct iw_cm_id *cm_id, int backlog)
2050 goto fail3; 2050 goto fail3;
2051 2051
2052 /* wait for pass_open_rpl */ 2052 /* wait for pass_open_rpl */
2053 wait_event(ep->com.waitq, ep->com.rpl_done); 2053 wait_event_timeout(ep->com.waitq, ep->com.rpl_done, C4IW_WR_TO);
2054 err = ep->com.rpl_err; 2054 if (ep->com.rpl_done)
2055 err = ep->com.rpl_err;
2056 else {
2057 printk(KERN_ERR MOD "Device %s not responding!\n",
2058 pci_name(ep->com.dev->rdev.lldi.pdev));
2059 ep->com.dev->rdev.flags = T4_FATAL_ERROR;
2060 err = -EIO;
2061 }
2055 if (!err) { 2062 if (!err) {
2056 cm_id->provider_data = ep; 2063 cm_id->provider_data = ep;
2057 goto out; 2064 goto out;
@@ -2080,10 +2087,17 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id)
2080 err = listen_stop(ep); 2087 err = listen_stop(ep);
2081 if (err) 2088 if (err)
2082 goto done; 2089 goto done;
2083 wait_event(ep->com.waitq, ep->com.rpl_done); 2090 wait_event_timeout(ep->com.waitq, ep->com.rpl_done, C4IW_WR_TO);
2091 if (ep->com.rpl_done)
2092 err = ep->com.rpl_err;
2093 else {
2094 printk(KERN_ERR MOD "Device %s not responding!\n",
2095 pci_name(ep->com.dev->rdev.lldi.pdev));
2096 ep->com.dev->rdev.flags = T4_FATAL_ERROR;
2097 err = -EIO;
2098 }
2084 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, PF_INET); 2099 cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, PF_INET);
2085done: 2100done:
2086 err = ep->com.rpl_err;
2087 cm_id->rem_ref(cm_id); 2101 cm_id->rem_ref(cm_id);
2088 c4iw_put_ep(&ep->com); 2102 c4iw_put_ep(&ep->com);
2089 return err; 2103 return err;