diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2006-02-07 01:47:12 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2006-02-07 01:47:12 -0500 |
commit | 3c9b3a8575b4f2551e3b5b74ffa1c3559c6338eb (patch) | |
tree | 7f8d84353852401ec74e005f6f0b1eb958b9a70d /drivers/infiniband/hw/mthca/mthca_cmd.c | |
parent | c0d3c0c0ce94d3db893577ae98e64414d92e49d8 (diff) | |
parent | c03296a868ae7c91aa2d8b372184763b18f16d7a (diff) |
Merge branch 'master'
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_cmd.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_cmd.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c index be1791be627b..f9b9b93dc501 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 | mutex_lock(&dev->cmd.hcr_mutex); |
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; |
@@ -238,7 +237,7 @@ static int mthca_cmd_post(struct mthca_dev *dev, | |||
238 | op), dev->hcr + 6 * 4); | 237 | op), dev->hcr + 6 * 4); |
239 | 238 | ||
240 | out: | 239 | out: |
241 | up(&dev->cmd.hcr_sem); | 240 | mutex_unlock(&dev->cmd.hcr_mutex); |
242 | return err; | 241 | return err; |
243 | } | 242 | } |
244 | 243 | ||
@@ -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); |
@@ -438,7 +435,7 @@ static int mthca_cmd_imm(struct mthca_dev *dev, | |||
438 | 435 | ||
439 | int mthca_cmd_init(struct mthca_dev *dev) | 436 | int mthca_cmd_init(struct mthca_dev *dev) |
440 | { | 437 | { |
441 | sema_init(&dev->cmd.hcr_sem, 1); | 438 | mutex_init(&dev->cmd.hcr_mutex); |
442 | sema_init(&dev->cmd.poll_sem, 1); | 439 | sema_init(&dev->cmd.poll_sem, 1); |
443 | dev->cmd.use_events = 0; | 440 | dev->cmd.use_events = 0; |
444 | 441 | ||