In my completion handler, I called usb_clear_halt if urb->status<0. When the cable is unplugged, the completion handler is called with urb->status = -EOVERFLOW (why is it called before "disconnect"?),
The disconnect() callback is issued when khubd gets around to it. Which will be on average a bit more than 1/8 second since the device was disconnected.
Different host controller silicon reports different faults for I/O attempts during that 1/8+ second. I don't know any host controller that will report an -EOVERFLOW in that situation though.
and the system hangs at usb_clear_halt. I thought there should be some protection around for this situation, as the system already knows some bad things happen. Btw, in which situation should I use usb_clear_halt and What is that for?
See the Linux 2.6 kerneldoc for USB, and the USB 2.0 spec. Use it in a task context (NOT completion handlers!) when a bulk or interrupt endpoint stalls (-EPIPE), as part of your fault recovery logic.
- Dave
------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
