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 357 context->status = status; 358 358 context->out_param = out_param; 359 359 360 - context->token += dev->cmd.token_mask + 1; 361 - 362 360 complete(&context->done); 363 361 } 364 362 ··· 378 380 spin_lock(&dev->cmd.context_lock); 379 381 BUG_ON(dev->cmd.free_head < 0); 380 382 context = &dev->cmd.context[dev->cmd.free_head]; 383 + context->token += dev->cmd.token_mask + 1; 381 384 dev->cmd.free_head = context->next; 382 385 spin_unlock(&dev->cmd.context_lock); 383 386