On Fri, 1 Jul 2005, Matthias Urlichs wrote: > > But during a normal rmmod the HC _is_ running. So how does this > > end up solving your problem? Does ohci-hcd somehow learn that the > > controller is _not_ running? > > > During a normal rmmod the HC is running; however, PCMCIA is special in > that it can be pulled at any time. So the OHCI driver has a few checks > for "this only happens when the hardware is gone" results (all bits 1).
Okay, that explains it. > > The correct way to handle this is to change the HCD. Not just ohci-hcd, > > but every HCD should be able to unlink URBs when the hardware isn't > > working properly. This may require adding a timer, to check that unlinks > > complete no more than a few hundred milliseconds after they are started. > > I have added an OHCI-internal timer. It seems to work, though of course > it's still a proof-of-concept implementation, tailored to our specific > problem. > > I'll have to test that one a bit more. I don't know if the problem is > sufficiently generic that a common implementation is warranted; uhci > already has a stall timer (which I haven't examined); ehci might suffer > from the same problem as the ohci driver when the card is pulled. The stall timer in uhci-hcd may end up being replaced by the hub_status_data callback, but you're right that this is where the check should be made. The situation here is slightly different, because the driver already has code to finish unlinks when the controller dies. What's missing is a test during the timer routine to see whether the controller is still alive. Such a test should take two forms. First, make sure that interrupts are being generated. If the driver knows an interrupt should arrive soon, but none appears for two successive calls of the timer routine, then the controller isn't working. That may be sufficient, but just in case the routine should also check to make sure the frame number is changing. An otherwise working controller that doesn't increment the frame number will also prevent unlinks from completing. This is on the list of changes I need to make to uhci-hcd. So you shouldn't worry about trying to write a generic or common implementation. Alan Stern ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
