Commit c1f74958 authored by Michael S. Tsirkin's avatar Michael S. Tsirkin Committed by Roland Dreier

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: default avatarMichael S. Tsirkin <mst@dev.mellanox.co.il>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent bd631048
...@@ -357,8 +357,6 @@ void mthca_cmd_event(struct mthca_dev *dev, ...@@ -357,8 +357,6 @@ void mthca_cmd_event(struct mthca_dev *dev,
context->status = status; context->status = status;
context->out_param = out_param; context->out_param = out_param;
context->token += dev->cmd.token_mask + 1;
complete(&context->done); complete(&context->done);
} }
...@@ -380,6 +378,7 @@ static int mthca_cmd_wait(struct mthca_dev *dev, ...@@ -380,6 +378,7 @@ static int mthca_cmd_wait(struct mthca_dev *dev,
spin_lock(&dev->cmd.context_lock); spin_lock(&dev->cmd.context_lock);
BUG_ON(dev->cmd.free_head < 0); BUG_ON(dev->cmd.free_head < 0);
context = &dev->cmd.context[dev->cmd.free_head]; context = &dev->cmd.context[dev->cmd.free_head];
context->token += dev->cmd.token_mask + 1;
dev->cmd.free_head = context->next; dev->cmd.free_head = context->next;
spin_unlock(&dev->cmd.context_lock); spin_unlock(&dev->cmd.context_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment