On Wed, 11 Jul 2007, jidong xiao wrote:

> Ok,let's talk about the timeout handling routine,we defined a
> timeout_handler in drivers/usb/storage/transport.c,inside that
> function,we will call usb_unlink_urb,why cannot we sleep?what impact
> if the driver go to sleep here?

In addition to what Oliver said, you should realize that there are 
situations where the kernel must not sleep.  For example, the kernel is 
not allowed to sleep in an interrupt handler or any sort of bottom-half 
handler.  Since timer routines are a form of bottom-half, they cannot 
sleep.

If the driver did try to call usb_kill_urb, you would get a big fat 
error message on the screen and your system might crash.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to