[ofa-general] Re: [PATCH] IB/mthca: change command token on timeout

Roland Dreier rdreier at cisco.com
Fri Jul 20 20:41:23 PDT 2007


thanks, I applied this and also did the same thing for mlx4:

commit 8a7bc1f72356a1f7dc67a168067c3942e8db395a
Author: Roland Dreier <rolandd at cisco.com>
Date:   Fri Jul 20 20:39:31 2007 -0700

    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 at 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 at cisco.com>

diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c
index c1f81a9..5d791e4 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)
 	context->result    = mlx4_status_to_errno(status);
 	context->out_param = out_param;
 
-	context->token += priv->cmd.token_mask + 1;
-
 	complete(&context->done);
 }
 
@@ -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 += priv->cmd.token_mask + 1;
 	cmd->free_head = context->next;
 	spin_unlock(&cmd->context_lock);
 



More information about the general mailing list