The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I'm new to window drivers development and I'm currently trying to get into an existing driver's bug that I have to resolve.
Here's the basic design:
We have custom PCIe HW card with a DMA core on it which is responsible for streaming data into the PC's memory via the PCIe bus.
As soon as a chunk of new data is copied by the external DMA core, an MSI interrupt is generated and the driver's MSI ISR wakes up.
The MSI ISR only reads an internal register of our card to distinguish between a nominal-data-ready interrupt and some other error interrupts,
and if the interrupt is a data-ready one, it calls the WdfDpcEnqueue routine to handle an event to the DPC.
The DPC, in turn, is responsible for copying the data from the memory buffer filled by the DMA core, to a larger cyclic buffer to allow the procedure to repeat without overriding the data in the buffer.
The problem I'm facing is that once in a while (~once a day, under stress conditions) data in the memory buffer is overridden.
I've instrumented my code using the TraceLogging API to insert a trace event at each point of the process (MSI ISR start, MSI ISR end, DPC start, DPC end, Memory buffer overrun, etc') in order to understand whether I'm loosing interrupts or DPC's or any other problem.
the MSI ISR is running but the matching DPC isn't called, and when the next MSI ISR is running and its matching DPC is called, the data in the buffer is already overridden.
My question is: what could possibly prevent a DPC from running?
How can I continue my debugging session from here?
Note: WdfDpcEnqueue returned TRUE.
Thanks in advance!
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Kernel Debugging||16-20 October 2023||Live, Online|
|Developing Minifilters||13-17 November 2023||Live, Online|
|Internals & Software Drivers||4-8 Dec 2023||Live, Online|
|Writing WDF Drivers||10-14 July 2023||Live, Online|