diff options
author | Steve Wise <swise@opengridcomputing.com> | 2010-09-10 12:15:25 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-09-28 13:46:34 -0400 |
commit | aadc4df3087a33ca7fc37f91a024e7b7efdafa75 (patch) | |
tree | 41e5da5350ce779d1f6058329166ab9da0cc4c61 /drivers/infiniband/hw/cxgb4/cq.c | |
parent | 9e8d1fa3420f489da8a5da47c026511aa71fa50b (diff) |
RDMA/cxgb4: Centralize the wait logic
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/cq.c')
-rw-r--r-- | drivers/infiniband/hw/cxgb4/cq.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c index 70371e92f2a5..8d8f8add6fcd 100644 --- a/drivers/infiniband/hw/cxgb4/cq.c +++ b/drivers/infiniband/hw/cxgb4/cq.c | |||
@@ -64,14 +64,7 @@ static int destroy_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, | |||
64 | c4iw_init_wr_wait(&wr_wait); | 64 | c4iw_init_wr_wait(&wr_wait); |
65 | ret = c4iw_ofld_send(rdev, skb); | 65 | ret = c4iw_ofld_send(rdev, skb); |
66 | if (!ret) { | 66 | if (!ret) { |
67 | wait_event_timeout(wr_wait.wait, wr_wait.done, C4IW_WR_TO); | 67 | ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, __func__); |
68 | if (!wr_wait.done) { | ||
69 | printk(KERN_ERR MOD "Device %s not responding!\n", | ||
70 | pci_name(rdev->lldi.pdev)); | ||
71 | rdev->flags = T4_FATAL_ERROR; | ||
72 | ret = -EIO; | ||
73 | } else | ||
74 | ret = wr_wait.ret; | ||
75 | } | 68 | } |
76 | 69 | ||
77 | kfree(cq->sw_queue); | 70 | kfree(cq->sw_queue); |
@@ -157,14 +150,7 @@ static int create_cq(struct c4iw_rdev *rdev, struct t4_cq *cq, | |||
157 | if (ret) | 150 | if (ret) |
158 | goto err4; | 151 | goto err4; |
159 | PDBG("%s wait_event wr_wait %p\n", __func__, &wr_wait); | 152 | PDBG("%s wait_event wr_wait %p\n", __func__, &wr_wait); |
160 | wait_event_timeout(wr_wait.wait, wr_wait.done, C4IW_WR_TO); | 153 | ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, __func__); |
161 | if (!wr_wait.done) { | ||
162 | printk(KERN_ERR MOD "Device %s not responding!\n", | ||
163 | pci_name(rdev->lldi.pdev)); | ||
164 | rdev->flags = T4_FATAL_ERROR; | ||
165 | ret = -EIO; | ||
166 | } else | ||
167 | ret = wr_wait.ret; | ||
168 | if (ret) | 154 | if (ret) |
169 | goto err4; | 155 | goto err4; |
170 | 156 | ||