Bernd Porr wrote:
Hi all,

I'm running an USB interrupt transfer with 2.4.22. It works fine until I unlink it. The reason is that the dev entry in the urb is zero. Unlink simply returns an error -19. If I force urb->dev to the dev I got from probe I get an -EINVAL. So the transfer loops forever and only a reboot can stop it.

That is, unlink during completion callback? I'd expect it to work fine at all other times, including on unplug.

I assume you're talking about the EHCI driver?  All the HCDs
in Linux "should" conform to the USB 2.0 spec ... though
only one supports "high speed"!


(Of course) I'm not sure that I don't have any bugs in my driver. But also an unlink(urb) in the completion handler returns with the same error. The call of the unlink in the completion handler is only an emergency measure. Usually this should not happen. But the unlink from other parts of the driver also fails. Thus, unlink in both the completion handler and my standard termination function fails.

Periodic transfers (interrupt and isochronous) in 2.4 relied on a nasty "automagic resubmit" mode that 2.6 finally removed. One of its problems was that during completion callbacks, there wasn't a single owner for the urb. In particular, the "urb->dev is zero" fix was a way to keep some of the HCDs from oopsing when drivers unlinked during the completion callbacks.

The "hcd" framework drivers were written around the 2.6 model,
where completion always means the same thing:  hcd no longer owns
the URB.  So the INTR_AUTOMAGIC code you noticed patches over
most of that, modulo the glitch you also noticed.  Hence the
need for the workaround you also noticed!

- Dave



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to