schedule_work returns FAILURE (0)

From: Ravi Dubey
Date: Sun Sep 25 2005 - 23:27:18 EST


Hi,

I have ported my USB driver on from Linux Kernel 2.4.20-8 to 2.6.11.12.
As a part of this porting process, I have replaced the bottom halves
with work_queues. Now, I am facing problems in the driver execution.
:-(.

The schedule_work() function which schedules the work is returning
FAILURE (0) many times (at least 1 out of 4 times it is called).

My queries:

1. When a work is queued using schedule_work (), does the function (that
is to be called as bottom half) run at process context OR Interrupt
context - The reason why I am getting confused is that in this called
function, if I print the return value of in_interrupt (), I get 0 (which
means that is running at process context), However, if I print the value
of in_interrupt after I have acquired a spin lock in this function, I
get the value 256 (which means I am running in interrupt context) ?

2. Why is the schedule_work () function failing. - I can't use
flush_workqueue in interrupt context, so is there any way; I can force
the work in the work queue to be scheduled.

Best Regards
Ravi





********************** Legal Disclaimer ****************************
"This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you."
**********************************************************************

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