On Tue, 22 Jul 2003, David Brownell wrote:

> Alan Stern wrote:
> 
> > Oh yes, I was wondering about this last night:  How should an HC that has
> > died be handled?  Clearly all its URBs need to be returned with an error
> > code like -ESHUTDOWN.  But the UHCI driver's dequeueing code is
> > interrupt-driven, and those interrupts won't arrive if the HC is stopped.
> 
> Which is a problem.  What OHCI does is to have an alternative
> for the dequeue logic in the case that the HC has halted:  it
> just cleans up the data structure without hardware synch.  And
> the EHCI code does the same.

Evidently the UHCI driver could use such an alternative path.

> Doing that cleaned up a bunch of problems with OHCI.  The
> obvious one was the (rare) controller halt.  But having
> that infrastructure in place is what now lets us clean up
> properly on device disconnect and config change events;
> and the relevant cleanup also got rid of some mem leaks
> on D3cold system PM resume scenarios.

I'm not sure how relevant that is to UHCI.  There doesn't seem to be any 
special cleanup needed on disconnect or config change events, since the 
driver doesn't really track endpoints anyway.

> > Does the driver need additional code to handle this situation?  Bear in 
> > mind that even if the HC is merely suspended, unlinking URBs won't work.
> 
> Yes, additional code; shouldn't be much.  I'm not sure it
> should be possible to suspend the HC if an urb is pending;
> does that really make sense?

Well, perhaps it doesn't really make sense, but it can happen nonetheless.  
Suspending the HC is simply a matter of setting/clearing the appropriate 
bits in a control register.  Whether or not any QHs or TDs are still in 
the hardware schedule won't make any difference.

Alan Stern

P.S.: A few days ago you mentioned that even for unlinked URBs, a driver
can tell how much data was transferred by looking at the actual_length
field (not that any of them bother to do so).  It turns out that the UHCI
driver doesn't set that field when an URB is unlinked.  Nor does it halt 
the corresponding queue.

P.P.S.: A question came up in this mailing list not long ago concerning
the urb->timeout field.  UHCI doesn't support it any longer (I vaguely
recall that it did at one point).  Since the other drivers don't support
it either, this seems like a good reason to get rid of it.  Or
alternatively, support could be added more simply and easily in the hcd
glue layer.



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to