diff options
author | Steve Wise <swise@opengridcomputing.com> | 2010-07-23 19:12:43 +0000 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-08-04 09:54:42 -0700 |
commit | a5f4a07820ebc60b21c984d893f48402c4b4a4a2 (patch) | |
tree | 08566f15e1a8b73a3f71a03234e015cf79d00470 /drivers/infiniband | |
parent | ca5a22028d0845dd6bcce0dce12a7beda315baf0 (diff) | |
download | kernel_samsung_smdk4412-a5f4a07820ebc60b21c984d893f48402c4b4a4a2.zip kernel_samsung_smdk4412-a5f4a07820ebc60b21c984d893f48402c4b4a4a2.tar.gz kernel_samsung_smdk4412-a5f4a07820ebc60b21c984d893f48402c4b4a4a2.tar.bz2 |
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.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c index 3eff5df..6c40779 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) goto fail3; /* wait for pass_open_rpl */ - wait_event(ep->com.waitq, ep->com.rpl_done); - err = ep->com.rpl_err; + wait_event_timeout(ep->com.waitq, ep->com.rpl_done, C4IW_WR_TO); + if (ep->com.rpl_done) + err = ep->com.rpl_err; + else { + printk(KERN_ERR MOD "Device %s not responding!\n", + pci_name(ep->com.dev->rdev.lldi.pdev)); + ep->com.dev->rdev.flags = T4_FATAL_ERROR; + err = -EIO; + } if (!err) { cm_id->provider_data = ep; goto out; @@ -2080,10 +2087,17 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id) err = listen_stop(ep); if (err) goto done; - wait_event(ep->com.waitq, ep->com.rpl_done); + wait_event_timeout(ep->com.waitq, ep->com.rpl_done, C4IW_WR_TO); + if (ep->com.rpl_done) + err = ep->com.rpl_err; + else { + printk(KERN_ERR MOD "Device %s not responding!\n", + pci_name(ep->com.dev->rdev.lldi.pdev)); + ep->com.dev->rdev.flags = T4_FATAL_ERROR; + err = -EIO; + } cxgb4_free_stid(ep->com.dev->rdev.lldi.tids, ep->stid, PF_INET); done: - err = ep->com.rpl_err; cm_id->rem_ref(cm_id); c4iw_put_ep(&ep->com); return err; |