On Tue, 3 Jan 2006, Franck wrote:

> Alan
> 
> 2006/1/2, Alan Stern <[EMAIL PROTECTED]>:
> >
> > You should turn off PORT_SUSPEND and set the C_PORT_SUSPEND flag (that's
> > what you meant, isn't it?) when you handle a GetPortStatus request coming
> > at least 20 ms after the remote wakeup request arrives.
> >
> 
> I'm sorry but I don't understand. Let's say that a device is suspended
> but the bus is not. The suspended device signals a remote wakeup
> signaling. The hcd get a resume detect interrupt if this signal lasts
> at least 2.5us. The hcd should wait for the remote wake up device to
> stop driving the bus (it can last no more than 15ms). Then the HCD
> should send the resume signaling within 1ms for at least 20ms. Is that
> correct ?

Not quite.  The HCD doesn't wait for the device to stop driving the bus;  
it must begin resume signalling within 1 ms of the time it first receives
the remote wakeup signal.  This is described in section 11.5.1.10 of the
USB 2.0 spec and also in 7.1.7.7.

> You told me to look at uhci driver example. It looks like it uses
> khubd polling (every 250ms) to check if a resume signaling should be
> sent...If so I don't see how we can fullfill previous timining
> constraints...

What I didn't mention is that the driver's interrupt handler arranges for
another poll to take place immediately whenever it receives a remote
wakeup request.  You can see that in uhci-hcd.c:uhci_irq().


> > No.  You shouldn't call usb_hcd_resume_root_hub() unless your root hub
> > (i.e., your bus) is suspended.
> 
> I put in my "resume detect" interrupt handler :
> 
>         if (hcd->state == HC_STATE_SUSPENDED)
>                 usb_hcd_resume_root_hub(hcd);
> 
> Is that correct ?

It's correct if and only if hcd->state behaves properly.  Note that 
hcd->state can be set by code outside of your driver, so it's not totally 
reliable.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&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

Reply via email to