lkml.org 
[lkml]   [2007]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Subjectwait_for_completion_timeout problem ???
From
Date
Hi,

I have a problem with using this function. I am referring to
drivers/infiniband/hw/mthca/mthca_cmd.c line 394. For convenience I
quote from this code:

init_completion(&context->done);

err = mthca_cmd_post(dev, in_param,
out_param ? *out_param : 0,
in_modifier, op_modifier,
op, context->token, 1);
if (err)
goto out;

if (!wait_for_completion_timeout(&context->done, timeout)) {
err = -EBUSY;
goto out;
}

timeout is 10 * HZ. Sometimes this function returns 0 which signifies
timeout. However I can see that the interrupt handler called
complete(&context->done)
around 200 usec after calling wait_for_completion_timout(). When the
function returns I can see that context->done.done equals 1 which
confirms that complete was indeed called. Looking at the implementation
of wait_for_completion_timout() it appears that complete() did not
succeed to wake the process sleeping. But the timer callback function in
schedule_timeout() did manage to wake up the sleeping process. Do you
have any idea if there are any known circumstances that can lead to this
behaviour. Any idea how to debug this?

Thanks
Eli
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-03-01 14:33    [W:0.089 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site