diff options
author | Roland Dreier <rolandd@cisco.com> | 2007-07-21 00:19:43 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-07-21 00:19:43 -0400 |
commit | 0981582dbfae86ba0306406f1af329bb702752d2 (patch) | |
tree | aae961cd3a5ca4b1e23278e70527058026048986 | |
parent | c1f74958dbd19f6a837d887ed416688c063af529 (diff) |
mlx4_core: 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.
This is the same change as the patch for mthca from Michael
S. Tsirkin <mst@dev.mellanox.co.il> that was just merged. It seems
sensible to avoid gratuitous differences in FW command processing
between mthca and mlx4.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r-- | drivers/net/mlx4/cmd.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c index c1f81a993f5d..a9f31753661a 100644 --- a/drivers/net/mlx4/cmd.c +++ b/drivers/net/mlx4/cmd.c | |||
@@ -246,8 +246,6 @@ void mlx4_cmd_event(struct mlx4_dev *dev, u16 token, u8 status, u64 out_param) | |||
246 | context->result = mlx4_status_to_errno(status); | 246 | context->result = mlx4_status_to_errno(status); |
247 | context->out_param = out_param; | 247 | context->out_param = out_param; |
248 | 248 | ||
249 | context->token += priv->cmd.token_mask + 1; | ||
250 | |||
251 | complete(&context->done); | 249 | complete(&context->done); |
252 | } | 250 | } |
253 | 251 | ||
@@ -264,6 +262,7 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param, | |||
264 | spin_lock(&cmd->context_lock); | 262 | spin_lock(&cmd->context_lock); |
265 | BUG_ON(cmd->free_head < 0); | 263 | BUG_ON(cmd->free_head < 0); |
266 | context = &cmd->context[cmd->free_head]; | 264 | context = &cmd->context[cmd->free_head]; |
265 | context->token += cmd->token_mask + 1; | ||
267 | cmd->free_head = context->next; | 266 | cmd->free_head = context->next; |
268 | spin_unlock(&cmd->context_lock); | 267 | spin_unlock(&cmd->context_lock); |
269 | 268 | ||