Hi all.

I'm developing a USB 2.0 driver for XP that runs in and out isoch and
bulk pipes at the same time.

On SMP machines I'm seeing the following issue: As long as only isoch
irps are submitted, the isoch irp IoCompletionRoutine gets called
immediately (or at least less than 1 ms) after the IN stream urb was
filled with data.

However, as soon as bulk or control requests are submitted
asynchronously, there is a certain chance that the callback into the
isoch IoCompletionRoutine gets delayed for up to 10 ms.

This happens only on SMP machines and only with the MS USB 2.0 EHCI
driver, I'm not seeing any starvation on single processor systems or
when using the USB 1.1 UHCI driver on SMP systems.

The starvation always occurs if the bulk request was submitted right
before the isoch IoCompletionRoutine is due.

I tried synchronizing the bulk requests with the isoch requests (i.e.
only issue a bulk request immediately after an isoch request). This
reduced the frequency of the starving issue a lot. However, I'm still
seeing delays from time to time, especially if the bulk traffic is high.

Another workaround might be to set the processor affinity for both, the
isoch and the bulk requests to the same CPU. However, to do this, I
would need to change the processor affinity of the EHCI DPC that issues
the IoCompletionRoutine. Is there a way to retrieve the PKDPC from the
IoCompletionRoutine? I guess not.

So my question is: Is this a known issue, and if so, is there a better
workaround?

-- Stephan