On Thu, 30 Jun 2005, Matthias Urlichs wrote: > > usb_disconnect does not disable the chip -- that happens after it returns. > > The only way usb_disconnect interacts with the controller is through the > > hcd_endpoint_disable routine. That in turn does a normal unlink (which > > you say will not work) and then calls the HCD's endpoint_disable method, > > which is supposed to block until all URBs for the endpoint have completed. > > Are you saying that the endpoint_disable method can force an uncompleted > > unlink to complete? > > > usb_disconnect() ends up calling finish_unlink() with the pointer to > the OHCI chip internals NULL, which is a valid way of saying "cleanup > the damn list without looking at the OHCI state".
I get it. And that call to finish_unlinks is made from within the ohci_endpoint_disable routine. It looks like the "clean up the list without looking at the hardware state" happens only when the HC isn't running. 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? 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. If an unlink takes longer than that, the driver should assume that the hardware has died and should force unlinks to complete immediately. It shouldn't be necessary to wait for someone to call endpoint_disable. Unfortunately I don't know enough about ohci-hcd to make such a change. 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 _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel