Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27606
b: refs/heads/master
c: e9cd594
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Jun 18, 2006
1 parent c4c556c commit 7c1292d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f5358a172f79e3f995919224401b25637f4324f6
refs/heads/master: e9cd59418f049966a690372c4919e98c88bb119b
23 changes: 4 additions & 19 deletions trunk/drivers/infiniband/hw/mthca/mthca_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ enum {

struct mthca_cmd_context {
struct completion done;
struct timer_list timer;
int result;
int next;
u64 out_param;
Expand Down Expand Up @@ -362,15 +361,6 @@ void mthca_cmd_event(struct mthca_dev *dev,
complete(&context->done);
}

static void event_timeout(unsigned long context_ptr)
{
struct mthca_cmd_context *context =
(struct mthca_cmd_context *) context_ptr;

context->result = -EBUSY;
complete(&context->done);
}

static int mthca_cmd_wait(struct mthca_dev *dev,
u64 in_param,
u64 *out_param,
Expand Down Expand Up @@ -401,11 +391,10 @@ static int mthca_cmd_wait(struct mthca_dev *dev,
if (err)
goto out;

context->timer.expires = jiffies + timeout;
add_timer(&context->timer);

wait_for_completion(&context->done);
del_timer_sync(&context->timer);
if (!wait_for_completion_timeout(&context->done, timeout)) {
err = -EBUSY;
goto out;
}

err = context->result;
if (err)
Expand Down Expand Up @@ -535,10 +524,6 @@ int mthca_cmd_use_events(struct mthca_dev *dev)
for (i = 0; i < dev->cmd.max_cmds; ++i) {
dev->cmd.context[i].token = i;
dev->cmd.context[i].next = i + 1;
init_timer(&dev->cmd.context[i].timer);
dev->cmd.context[i].timer.data =
(unsigned long) &dev->cmd.context[i];
dev->cmd.context[i].timer.function = event_timeout;
}

dev->cmd.context[dev->cmd.max_cmds - 1].next = -1;
Expand Down

0 comments on commit 7c1292d

Please sign in to comment.