aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_cmd.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@dev.mellanox.co.il>2007-07-19 07:28:49 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-21 00:19:43 -0400
commitc1f74958dbd19f6a837d887ed416688c063af529 (patch)
tree57c9763e30d93e9a9f22b059ee65a655769c3726 /drivers/infiniband/hw/mthca/mthca_cmd.c
parentbd631048116df40837667a72c578b170c906dd30 (diff)
IB/mthca: Change command token on timeout
The FW command token is currently only updated on a command completion event. This means that on command timeout, the same token will be reused for new command, which results in a mess if the timed out command *does* eventually complete. Signed-off-by: Michael S. Tsirkin <mst@dev.mellanox.co.il> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_cmd.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_cmd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c
index f40558d76475..acc95892713a 100644
--- a/drivers/infiniband/hw/mthca/mthca_cmd.c
+++ b/drivers/infiniband/hw/mthca/mthca_cmd.c
@@ -357,8 +357,6 @@ void mthca_cmd_event(struct mthca_dev *dev,
357 context->status = status; 357 context->status = status;
358 context->out_param = out_param; 358 context->out_param = out_param;
359 359
360 context->token += dev->cmd.token_mask + 1;
361
362 complete(&context->done); 360 complete(&context->done);
363} 361}
364 362
@@ -380,6 +378,7 @@ static int mthca_cmd_wait(struct mthca_dev *dev,
380 spin_lock(&dev->cmd.context_lock); 378 spin_lock(&dev->cmd.context_lock);
381 BUG_ON(dev->cmd.free_head < 0); 379 BUG_ON(dev->cmd.free_head < 0);
382 context = &dev->cmd.context[dev->cmd.free_head]; 380 context = &dev->cmd.context[dev->cmd.free_head];
381 context->token += dev->cmd.token_mask + 1;
383 dev->cmd.free_head = context->next; 382 dev->cmd.free_head = context->next;
384 spin_unlock(&dev->cmd.context_lock); 383 spin_unlock(&dev->cmd.context_lock);
385 384