USB remote wakeup speed

I just measured the time between remote wakeup issued by device and computer (XP SP2) reaction i.e. CLEAR_FEATURE request when device was selectively suspended. The results are depressing. On rather fast computer with EHCI HC it is 94 ms, on relatively slow one (2x933 MHz) with UHCI HC it is 158 ms. Next computers are in between. I measured number of SOFs since suspend end to CLEAR_FEATURE so it is the software reaction time, not hw. My USB driver has Wait Wake IRP queued and it is on OS to react. The time between WW IRP completion and sunsequent D0 IRP is less than 200 us and D0 is completed within 4 ms. All the time is spent before WW IRP is completed.

Is there any way how to make it faster? For one of our devices which can’t buffer data it means we can’t use selective suspend because too much data are lost before PC can start grabbing. We can afford about 50 - 60 ms but it includes one interrupt endpoint and several control endpoint transfers before data (bulk) transfer can start. It means we’d need remote wakeup processing within about 30 ms. This seems as a lot of time on modern computers. Does anybody have an idea why OS reacts so slowly?

BTW, I haven’t found any limit in the USB specs. Is there one?

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]