Hello,
My company develops USB3 devices and I am on the driver team. We are developing an xHCI bus driver (in addition to a device driver specifically for our device) in WDF and we are having some odd problems with our DMAing of data, specifically bulk-in data.
Our device driver is pretty solid; it works very well when using any xHCI card we’ve tried with those vendors’ controller drivers installed. Therefore, I’m very certain that this problem is in the bus driver and not the device driver.
What happens is that the data comes in with blocks “missing”. What should be a solid data stream has empty portions in it, as well as slightly misaligned portions. These empty portions are the same size and in the same place each time, and happen intermittently (ie, not every transfer). In other words, If I have a 100,000 byte data transfer, I might get something like this:
-good transfer-
-good transfer-
-bad transfer- bytes 2400 ~ 5000 “empty”, bytes 26700 ~ 27700 also “empty”
-good transfer-
-bad transfer- bytes 2400 ~ 5000 “empty”, bytes 26700 ~ 27700 also “empty”
-good transfer-
-good transfer-
… (etc)
Also, if I power cycle and restart the device, I’ll get similar behavior, but the pattern will be different. Sometimes there is just a small amount of corruption/empty spots, but sometimes pretty much every single data transfer is spotty and full of empty places (though consistently, the same places are empty).
The kicker is that sometimes this does NOT happen at all, and I’ll start the device and everything will work great for the duration that the device is plugged in:
-good transfer-
-good transfer-
-good transfer-
-good transfer-
… (etc)
There seems to be no specific reproduction case or pattern to getting this to happen. Further, I’ve look at the sizes of the “empty spots” in a hex editor and they are seemingly random sizes like 592 and 35120.
Can anyone think of any reason this might be happening?
I can provide code if anyone is willing to take a look. The fact that things completely work sometimes and are super spotty other times makes me wonder if this is some sort of synchronization issue or something? It seems like the actual DMA mechanism does work (sometimes
).