On Wed, 5 Jul 2006, Christopher Montgomery wrote:

> On 7/2/06, David Brownell <[EMAIL PROTECTED]> wrote:
> > On Sunday 02 July 2006 6:29 am, Christopher Montgomery wrote:
> >
> > > Disconnecting a hub/device causes two things to happen at the same time:
> > >
> > > 1) usb_disconnect is called on the root device.
> > > 2) each active transfer descriptor throws an interrupt/error each time
> > >    it comes up in the periodic schedule.
> >
> > Not "the same time" at all.  There can be big gaps between
> 
> Yes, same time.  Because 1) and 2) are being interwoven and I have the
> logs to prove it.

"The same time" and "interwoven" are two different things, although the 
difference is largely academic.  If you are using an SMP system then they 
really can be happening simultaneously.

> >  - physical disconnect, at which point pending transfers to child devices
> >    all start to error out (your #2);
> >
> >  - when khubd notices the disconnect as such, and marks the tree of
> >    disconnected devices as gone, so new requests won't be queued;
> 
> ... except that is not quite what's happening.  When the hub
> diappears, the process of 'marking the tree disconnected' is not
> masked against the interrupts pouring in for the now disappeared
> hardware,

Actually it is.  Look in drivers/usb/core/hub.c at the 
usb_set_device_state() routine.

> and while this process slowly moves forward, the rest of the
> USB subsystem is repeatedly trying to bring the devices back up;
> intr_descedule and qh_schedule are being called in a [potentially
> tight] loop.

Potentially tight doesn't have to mean tight.  Higher-level drivers should 
strive to avoid immediate resubmissions of URBs that fail because of 
device disconnection.  Some drivers do behave this way and some don't.

> >  - when usb_disconnect() is first called, first aborting all pending
> >    transfers to the disconnected devices (your #1, I think);
> 
> This can take over a second; usually not, but it can.  In the
> meantime, I'm getting up to an interrupt per endpoint per millisecond.

This will continue only for as long as the failed URBs continue to be 
resubmitted.  You should concentrate on making the higher-level driver 
resubmit at a slower rate.

Alan Stern


Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to