On Thu, 4 Aug 2005, Olav Kongas wrote:

> > This delay would only apply when the HC is waking up from a sleep state, 
> > right?  So a lot of the time it won't be necessary...
> 
> No. I haven't tested other configurations, but my corrent 
> device tree is: rh-port -> external hub -> mouse. If I 
> suspend just the corresponding rh-port, leaving the root hub 
> running, and then move the mouse, it still takes 10ms for a 
> port status register to stabilize.
> 
> > I think the easiest solution will be for your HCD to test whether a delay 
> > is needed.  If not, go ahead and call usb_hcd_poll_rh_status as usual.  If 
> > a delay is needed, then do
> 
> Relying on Resume Detected interrupt won't suffice, because 
> when suspending just a root hub port like above, the chip 
> won't generate Resume Detected but just Status Change. So, 
> the only sources of information to decide about the 
> necessity of delay I can think of would be those not jet 
> stabilized status registers :(
> 
> But I think it is OK to always use the delay.

An important case is where an active device, attached to a non-suspended
(obviously!) port, is unplugged or disabled.  It would be good to avoid
the unnecessary 10 ms delay when that happens, so that device drivers will
learn about the disconnect as soon as possible.  For everything else the
delay should be okay.

> > 
> >     mod_timer(&hcd->rh_timer, jiffies + msecs_to_jiffies(10));
> > 
> > This is the timer used by the root-hub polling code, so when it expires
> > your root hub will be polled like you want.  So long as you keep
> > hcd->poll_rh equal to 0, the timer will not be re-enabled after it
> > expires.
> > 
> > You will also have to modify your hub_status_data routine.  If the HC is 
> > suspended, it should return 0 rather than an error.  It just might end up 
> > getting called, if a suspend occurs during that 10-ms delay period.
> 
> Will do some more testing, but with your proposed scheme it 
> now works here nicely. Thanks.

Good, you're welcome.

Alan Stern



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
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