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 <[EMAIL PROTECTED]>

---

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)

_______________________________________________
general mailing list
general@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to