On Mon, 2 Jan 2006, Franck wrote: > > If the mouse device is suspended and the bus is active, then khubd will > > see the C_PORT_SUSPEND flag and will call remote_wakeup() to finish > > resuming the mouse. It doesn't just clear the flag. > > > > ok, but where is the hcd supposed to wake up the device here ?
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. For an example showing how this works, look at uhci_check_ports() and uhci_finish_suspend() in uhci-hub.c. > I don't > think it's done when getting the remote wakeup interrupt because we > should wait for the device to release the bus...then khubd will see > the C_PORT_SUSPEND flag and clear it. The device is still suspended. > Eventually khubd will call remote_wakeup, which will do a > usb_get_status. This last call will fail since the device is not > resumed... It won't fail. The same GetPortStatus call that retrieved the C_PORT_SUSPEND will also cause your driver to finish resuming the port. The GetDeviceStatus call won't be made for another 10 ms, by which time the device should be fully resumed. > > On the other hand, suppose the mouse and the bus are both suspended. > > When you move the mouse the HCD will get an interrupt and see that a > > remote wakeup request was received. Then the HCD should call > > usb_hcd_resume_root_hub() to tell khubd to re-activate the bus. Once > > that's done, khubd will see the C_PORT_SUSPEND bit and proceed as > > described above. > > > > Let say that my hcd has only one port. In both cases you described, > can the hcd call usb_hcd_resume_root_hub() and raise C_PORT_SUSPEND > flag when getting the remote wakeup interrupt ? No. You shouldn't call usb_hcd_resume_root_hub() unless your root hub (i.e., your bus) is suspended. And you shouldn't raise C_PORT_SUSPEND until you have turned off PORT_SUSPEND, which should be at least 20 ms after receiving the remote wakeup interrupt. 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 _______________________________________________ [email protected] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
