On Tue, 2004-01-13 at 05:20, David Brownell wrote:
> Neither; for now, disconnect() should wait until all the urbs complete.
> Definitely no timeout.

I patched my driver to use asynchronous unlinking and to
wait_for_completion() for the unlinked URB. There are two places now
where I do that. First in my "wait_for_completion"-ioctrl call that
detects the mentioned timeout of 3 seconds and then unlinks the URB.
Second in my disconnect function.

> Are you sure your wait_event() logic is working correctly?  One
> explanation for these questions is that it missed the event.

Lets say, I am pretty sure. If it would merely miss the event and the
URB would have successfully been unlinked the following unlink call
would not return -EBUSY and there would not really be a problem
(especially no kernel panic when I replug the device), wouldn't it?

> I'd use URB_ASYNC_UNLINK myself, but that's unlikely to be the root
> of the problem if your disconnect() is correctly waiting for all of
> the urbs to complete.

As said above my disconnect now waits asynchronously for the
urb_completion but as I expected, it never comes to that: the first
wait_event, resulting in the timeout, is now followed by an asynchronous
unlink and then waits for the completion and never returns -> the
program hangs.

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?

> Once the controller driver returned from its dequeue()
> method, that meant the URB was going to be returned "soon".  Isn't
> there a uhci timer that's supposed to make that happen?

I guess what I should do is to keep on trying to find the point where
the URB "gets stuck" by distributing more printks to the right places. I
know hcd_endpoint_disable()/unlink1() gets called and seems to do what
it's supposed to but giveback_urb() is never called for this urb. Any
suggestions where to go on?

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

Reply via email to