When I create an interrupt object in my driver the interrupt service routine is called constantly. This starts already at boot time, when the driver is loaded.
Now I was wondering how I can best debug this; could this be a hardware failure, or am I doing something terribly wrong in my driver.
The device is a PCIe device (so MSI based interrupts).
In the ISR, I retrieve the interrupt info and get the following print out (1000’s a second):
Enter: MSI? No, Interrupt type: Level Triggered, Share disposition: Shared, MessageID: 0, Int Vector: 387
This is my code:
NTSTATUS EvtDriverDeviceAdd(__in WDFDRIVER Driver, __in PWDFDEVICE_INIT DeviceInit)
{
PAGED_CODE();
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&attributes, DEVICE_EXTENSION);
attributes.EvtCleanupCallback = (PFN_WDF_OBJECT_CONTEXT_CLEANUP)EvtDeviceExtensionCleanup;
attributes.SynchronizationScope = WdfSynchronizationScopeDevice;
WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
pnpPowerCallbacks.EvtDevicePrepareHardware = EvtDevicePrepareHardware;
pnpPowerCallbacks.EvtDeviceReleaseHardware = EvtDeviceReleaseHardware;
WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &pnpPowerCallbacks);
status = WdfDeviceCreate(&DeviceInit, &attributes, &device);
WDF_INTERRUPT_CONFIG_INIT(&interruptConfig,EvtInterruptIsr,EvtInterruptDpc);
interruptConfig.EvtInterruptEnable = EvtInterruptEnable;
interruptConfig.EvtInterruptDisable = EvtInterruptDisable;
//interruptConfig.AutomaticSerialization = TRUE; /* Crashes when set to TRUE */
status = WdfInterruptCreate(device,&interruptConfig,WDF_NO_OBJECT_ATTRIBUTES,&pDevExt->Interrupt);
return status;
}
BOOLEAN VkEvtInterruptIsr(__in WDFINTERRUPT Interrupt, __in ULONG MessageID)
{
PVK_DEVICE_EXTENSION pDevExt;
BOOLEAN isRecognized = FALSE;
WDF_INTERRUPT_INFO Info;
WDF_INTERRUPT_INFO_INIT(&Info);
WdfInterruptGetInfo(Interrupt,&Info);
DbgPrint(“[Viking::VkEvtInterruptIsr] Enter: MSI? %s, Interrupt type: %s, Share disposition: %s, MessageID: %lu, Int Vector: %lu\n”,Info.MessageSignaled ? “Yes” : “No”, Info.Mode==Latched ? “Edge Triggered” : “Level Triggered”, Info.ShareDisposition == CmResourceShareShared ? “Shared” : “Exclusive”, MessageID, Info.Vector);
//WdfInterruptQueueDpcForIsr(pDevExt->Interrupt);
DbgPrint(“[Viking::VkEvtInterruptIsr] Leave\n”);
return isRecognized;
}
I read in the book Developing drivers with the Windows Driver Foundation that MSI interrupts are not supported prior to Vista (see page 538 at the top). Is this correct? And if so, how is XP handling MSI interrupts?
What does the Interrupt Vector number mean?
When I enable automatic serialization, the driver BSOD’s. What could be the reason for that?
Best regards,
Kurt