I am writing a KMDF DMA driver (again based on PLX9x5x sample - aren't they alll?) and I am seeing the following issue...
1/ In the Request handler (ReadFile, WriteFile, DeviceIoControl) I initialize and execute the transaction (WdfDmaTransactionInitialize, WdfDmaTransactionExecute)
2/ In the EvtProgramDma callback I acquire the interrupt lock and program for DMA xfer:
a. DMA 0 Mode Register (DMAMODE0)
b. Interrupt CSR Register (INTCSR)
c. DMA 0 Descriptor Pointer Register (DMADPR0)
d. DMA 0 CSR Register (DMACSR0)
3/ The ISR gets called, and here I:
a. read Interrupt CSR register (INTCSR)
b. clear interrupt (DMACSR0)
c. queue DPC
4/ In DPC I *think* I am re-enabling interrupts:
a. INTCSR &= ~DMA0_ACTIVE
b. INTCSR |= PCI_IRQ_ENABLE
c. DMACSR0 = 0
d. if transactionComplete, call Request Completion function, where I release DMA transaction object
My test application sends down one request at a time, and this all goes well for 1st invocation.
The issue occurs if I then try to send down another request:
The steps above are repeated, but after programming the hardware for DMA xfer in the EvtProgramDma callback (step 2/ above), the subsequent ISR never gets called?!
If I send down any more requests, BSOD results with invalid operation on DMA transaction object not in correct state, as I am trying to initialize before the previous object was released.
I notice the PLX9x5x sample in its DPC merely clears INTCSR and DMACSR0 in its device extension, but does not perform any actual register I/O, e.g. WRITE_PORT_ULONG.
Does anyone have an insight as to why the ISR is not called again?