On Tue, Apr 10, 2012 at 2:15 PM, Chen Peter-B29397 <B29397@xxxxxxxxxxxxx> wrote: > Hi Alan, > > In order to support remote wakeup well, we need to take some timing issues > into consideration. For example, after resuming signal, the SOF must be > sent by host within 3ms, or the device will suspend again, in that case, > the device may be taken as disconnection once host sends SOF. Looks ehci_bus_resume will do "Force Port Resume" on suspended ports, so in theory ehci host driver can deal with your case if RUN/STOP is set after handling port resume as done in attachment patch. The patch does work well in my box. Per ehci spec, RUN/STOP is used to start/stop transactions schedule, so it should be set after complete of port resume in ehci_bus_resume. > > For some controllers, the SOF is controlled by usbcmd.rs, only usbcmd.rs=1, > the host sends SOF. But according to ehci spec, the usbcmd.rs need to be clear > after bus suspend. The host set usbcmd.rs again at bus resume, but bus resume > routine may not be called with 20ms (Some controller will end resume signal > automatically within a little more than 20ms), then the above problem occurs. Looks the 20ms is the msleep(20) in ehci_bus_resume. > > The usb_hcd_resume_root_hub is only called at PCD interrupt when usbcmd.rs=0, > I would like to set usbcmd.rs as early as possible (at platform or controller > code), but don't want break usb core. Current, my solution is run > usb_hcd_resume_root_hub at controller code, and the PCD interrupt will be > triggered later. Any risks for this solution, do you have any better suggestions? IMO, it isn't a good idea to enable RUN/STOP very soon, which may cause early SOF sent to resuming ports. Thanks, -- Ming Lei
Attachment:
fsl.patch
Description: Binary data