[ofa-general] [PATCH] IB/mlx4 mlx4_ib: commands timeout

Eli Cohen eli at mellanox.co.il
Mon May 7 04:52:22 PDT 2007


When the system is busy it may happen that the command actually
completed but it took more than the specified timeout till the
task executing the command was actually given CPU time. This test
checks that the completion is really missing before failing.

Signed-off-by: Eli Cohen <eli at mellanox.co.il>

---

Index: connectx_kernel/drivers/net/mlx4/cmd.c
===================================================================
--- connectx_kernel.orig/drivers/net/mlx4/cmd.c	2007-05-07 12:32:35.000000000 +0300
+++ connectx_kernel/drivers/net/mlx4/cmd.c	2007-05-07 14:30:26.000000000 +0300
@@ -272,10 +272,11 @@ static int mlx4_cmd_wait(struct mlx4_dev
 	mlx4_cmd_post(dev, in_param, out_param ? *out_param : 0,
 		      in_modifier, op_modifier, op, context->token, 1);
 
-	if (!wait_for_completion_timeout(&context->done, msecs_to_jiffies(timeout))) {
-		err = -EBUSY;
-		goto out;
-	}
+	if (!wait_for_completion_timeout(&context->done, msecs_to_jiffies(timeout)))
+		if (!context->done.done) {
+			err = -EBUSY;
+			goto out;
+		}
 
 	err = context->result;
 	if (err)




More information about the general mailing list