Spinlock in EvtUsbTargetPipeReadComplete allowed?

Hello,

I’m writing a driver for a usb device which uses a continuous reader for a bulk pipe to read data. The data will be saved in a circular buffer inside of the device extension and i want to synchronize the access with a WdfSpinLock. For this I need to know if the IRQL of the EvtUsbTargetPipeReadComplete callback can be greater than DISPATCH_LEVEL. The documentation only says “The callback function is called at the IRQL at which the I/O target completed the read request, which is typically IRQL = DISPATCH_LEVEL.”. Does this mean that the IRQL is <= DISPATCH_LEVEL and I’m allowed to use the WdfSpinLock? If not, is there a documentation about the IRQL of USB I/O targets or do I have to use another synchronization technique?

Daniel

Yes, the IRQL will always be <= IRQL DISPATCH_LEVEL. IRQL DISPATCH_LEVEL is the highest IRQL at which I/O requests can be completed in Windows.

The docs should be more specific. File a bug as part of the WDK Community Bug Bash (http://www.osronline.com/page.cfm?name=bugbash) if you have not already done so.

Peter
OSR

Thanks for the help and the pointer to BugBash :slight_smile:

Daniel