Skip to content

Commit

Permalink
mlx4_core: Change command token on timeout
Browse files Browse the repository at this point in the history
    
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>
  • Loading branch information
Roland Dreier committed Jul 21, 2007
1 parent c1f7495 commit 0981582
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/mlx4/cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,6 @@ void mlx4_cmd_event(struct mlx4_dev *dev, u16 token, u8 status, u64 out_param)
context->result = mlx4_status_to_errno(status);
context->out_param = out_param;

context->token += priv->cmd.token_mask + 1;

complete(&context->done);
}

Expand All @@ -264,6 +262,7 @@ static int mlx4_cmd_wait(struct mlx4_dev *dev, u64 in_param, u64 *out_param,
spin_lock(&cmd->context_lock);
BUG_ON(cmd->free_head < 0);
context = &cmd->context[cmd->free_head];
context->token += cmd->token_mask + 1;
cmd->free_head = context->next;
spin_unlock(&cmd->context_lock);

Expand Down

0 comments on commit 0981582

Please sign in to comment.