On Wednesday 02 February 2005 5:35 am, [EMAIL PROTECTED] wrote:
> 
> Hi,
>  It seems that under some conditions when a usb device is physically
> disconnected and there are some pending urbs ehci_endpoint_disable
> can loop forever in state QH_STATE_UNLINK. 

Hmm, that might explain some rare and intermittent problem reports.

What makes you believe that's what's happening?


> I can't really see whether 
> this can be a hardware problem or it is purely in software as I don't
> understand the mechanisms involved.

Basic mechanisms:

 - If the HC is live:

     * For bulk or control endpoints, set up to use the
       "Interrupt on Async Advance" (IAA) Doorbell IRQ.
       this is what's near the end of ehci-q.c ... basically,
       take endpoint's QH off the async ring, arrange for someone
       to ring the doorbell.

     * For interrupt) endpoints, deschedule the QH and spin
       (typically for at most a millisecond) until the host
       could no longer be accessing it.  (Kind of ugly, but
       nice and simple.)

     * For isochronous endpoints, just wait till the TDs
       (split or otherwise) complete normally, in at most
       1024 milliseconds.  (Not as ugly, but simpler than
       trying to accelerate that unlink.)

 - Else the HC is dead; just prcoess all the TDs associated
   with that endpoint, there's nobody touching them.


> Can anyone suggest a debugging 
> technique? This happens with a clean 2.6.10 kernel.

Have you tried pr_debug() calls in the ehci_endpoint_disable()
logic, and enabling the existing debug output?

It'd be good to use 2.6.11-rc2 instead of 2.6.10, since some
of that code has changed.


>  This is triggered by my user space driver calling 
> usb_release_interface when it detects a disconnect by a read or write
> to the device failing.

So it could be a case of khubd and your driver competing
on doing the unlink processing...

- Dave


> 
> /Brian
> 
> 
>


-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to