aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c9
-rw-r--r--drivers/infiniband/hw/mthca/mthca_mcg.c14
2 files changed, 7 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index be1791be627b..69128fe60c53 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -199,8 +199,7 @@ static int mthca_cmd_post(struct mthca_dev *dev,
199{ 199{
200 int err = 0; 200 int err = 0;
201 201
202 if (down_interruptible(&dev->cmd.hcr_sem)) 202 down(&dev->cmd.hcr_sem);
203 return -EINTR;
204 203
205 if (event) { 204 if (event) {
206 unsigned long end = jiffies + GO_BIT_TIMEOUT; 205 unsigned long end = jiffies + GO_BIT_TIMEOUT;
@@ -255,8 +254,7 @@ static int mthca_cmd_poll(struct mthca_dev *dev,
255 int err = 0; 254 int err = 0;
256 unsigned long end; 255 unsigned long end;
257 256
258 if (down_interruptible(&dev->cmd.poll_sem)) 257 down(&dev->cmd.poll_sem);
259 return -EINTR;
260 258
261 err = mthca_cmd_post(dev, in_param, 259 err = mthca_cmd_post(dev, in_param,
262 out_param ? *out_param : 0, 260 out_param ? *out_param : 0,
@@ -333,8 +331,7 @@ static int mthca_cmd_wait(struct mthca_dev *dev,
333 int err = 0; 331 int err = 0;
334 struct mthca_cmd_context *context; 332 struct mthca_cmd_context *context;
335 333
336 if (down_interruptible(&dev->cmd.event_sem)) 334 down(&dev->cmd.event_sem);
337 return -EINTR;
338 335
339 spin_lock(&dev->cmd.context_lock); 336 spin_lock(&dev->cmd.context_lock);
340 BUG_ON(dev->cmd.free_head < 0); 337 BUG_ON(dev->cmd.free_head < 0);
diff --git a/drivers/infiniband/hw/mthca/mthca_mcg.c b/drivers/infiniband/hw/mthca/mthca_mcg.c
index 77bc6c746f43..55ff5e5bcfef 100644
--- a/drivers/infiniband/hw/mthca/mthca_mcg.c
+++ b/drivers/infiniband/hw/mthca/mthca_mcg.c
@@ -154,10 +154,7 @@ int mthca_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
154 return PTR_ERR(mailbox); 154 return PTR_ERR(mailbox);
155 mgm = mailbox->buf; 155 mgm = mailbox->buf;
156 156
157 if (down_interruptible(&dev->mcg_table.sem)) { 157 down(&dev->mcg_table.sem);
158 err = -EINTR;
159 goto err_sem;
160 }
161 158
162 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index); 159 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index);
163 if (err) 160 if (err)
@@ -242,7 +239,7 @@ int mthca_multicast_attach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
242 mthca_free(&dev->mcg_table.alloc, index); 239 mthca_free(&dev->mcg_table.alloc, index);
243 } 240 }
244 up(&dev->mcg_table.sem); 241 up(&dev->mcg_table.sem);
245 err_sem: 242
246 mthca_free_mailbox(dev, mailbox); 243 mthca_free_mailbox(dev, mailbox);
247 return err; 244 return err;
248} 245}
@@ -263,10 +260,7 @@ int mthca_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
263 return PTR_ERR(mailbox); 260 return PTR_ERR(mailbox);
264 mgm = mailbox->buf; 261 mgm = mailbox->buf;
265 262
266 if (down_interruptible(&dev->mcg_table.sem)) { 263 down(&dev->mcg_table.sem);
267 err = -EINTR;
268 goto err_sem;
269 }
270 264
271 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index); 265 err = find_mgm(dev, gid->raw, mailbox, &hash, &prev, &index);
272 if (err) 266 if (err)
@@ -372,7 +366,7 @@ int mthca_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
372 366
373 out: 367 out:
374 up(&dev->mcg_table.sem); 368 up(&dev->mcg_table.sem);
375 err_sem: 369
376 mthca_free_mailbox(dev, mailbox); 370 mthca_free_mailbox(dev, mailbox);
377 return err; 371 return err;
378} 372}