On Tue, 2004-01-13 at 16:36, Alan Stern wrote: > > I still have these printks in giveback() and found to my surprise that > > this function gets called repeatedly for an other urb with a frequency > > of about 4/sec. This starts about the same time the unplugging is > > detected, that means shortly after I see the "uhci_hcd 0000:00:07.2: > > shutdown urb" and keeps on endlessly. At that time there is no usb > > device attached to the machine. Maybe this behavior is part of the > > problem or a hint where to search next? > > Maybe. It indicates the the hub driver is stuck waiting for something; > most likely it's waiting for your driver to return from a call to its > disconnect routine.
That fits quite well with what I see. I switched back to my synchronous unlinking and now the these giveback() calls end as soon as disconnect() returns. > > It is not quite obvious to me where to go. If you could tell me the > > missing function calls "between" endpoint_disable()/unlink1() and > > giveback_urb(), that would be helpful. > > To both questions, the answer lies in the UHCI driver, > drivers/usb/host/uhci-hcd.c. Here are some good spots to try putting > printk's: > > uhci_urb_dequeue() is the routine that gets called via unlink1() > to dequeue your URB (your URB is put on the urb_remove_list); > > The grossly misnamed routine uhci_remove_pending_qhs() is the > one that notes when your URB can safely be sent to giveback_urb > (your URB is taken off the urb_remove_list and put on the > complete_list); > > uhci_finish_urb() is the routine that actually calls giveback_urb > (your URB is taken off the complete_list). Be careful about > this one because it gets called for every single URB, so it has > a lot of activity. > > If you can find out where in that sequence your URB is going and where it > is getting stuck, that will be a good step forward. I found that uhci_urb_dequeue gets called and calls uhci_unlink_generic() which in turn processes about 350 TDs, calls uhci_delete_queued_urb(), where it seems to find list_empty(&urbp->queue_list) to be true and immediately exits uhci_delete_queued_urb(). I see some uhci_remove_pending_qhs() calls before I unplug the device, that means in normal operation. But after the "usb 1-2: USB disconnect" line there is neither any uhci_remove_pending_qhs() call nor any uhci_finish_urb(). I am afraid I depend on you again to get an idea how that got me a good step forward :-). Thanks, Axel. ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel