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>

authored by Michael S. Tsirkin and committed by Roland Dreier c1f74958 bd631048

+1 -2
+1 -2
drivers/infiniband/hw/mthca/mthca_cmd.c
··· 357 context->status = status; 358 context->out_param = out_param; 359 360 - context->token += dev->cmd.token_mask + 1; 361 - 362 complete(&context->done); 363 } 364 ··· 378 spin_lock(&dev->cmd.context_lock); 379 BUG_ON(dev->cmd.free_head < 0); 380 context = &dev->cmd.context[dev->cmd.free_head]; 381 dev->cmd.free_head = context->next; 382 spin_unlock(&dev->cmd.context_lock); 383
··· 357 context->status = status; 358 context->out_param = out_param; 359 360 complete(&context->done); 361 } 362 ··· 380 spin_lock(&dev->cmd.context_lock); 381 BUG_ON(dev->cmd.free_head < 0); 382 context = &dev->cmd.context[dev->cmd.free_head]; 383 + context->token += dev->cmd.token_mask + 1; 384 dev->cmd.free_head = context->next; 385 spin_unlock(&dev->cmd.context_lock); 386