not receiving interrupt when MSI is configured

I am developing a WDF driver for a PCI-e based multiport serial controller. I want to configure MSI interrupts on my controller. I am doing this by adding the below statements to my .inf file.
HKR,Interrupt Management,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,0x00000010
HKR,Interrupt Management\MessageSignaledInterruptProperties,MSISupported,0x00010001,1

And i am seeing the MSI is getting configured by looking at PCI-e configuration space. The register at offset 0x8C has the below values after MSI is configured.
0081 A4 59

Looking at the value 81 i can say that MSI is configured.

Also my device is capable of MSI as per the datasheet and my vendor. Even in driver i am receiving the flag interruptDescTranslated->Flags as CM_RESOURCE_INTERRUPT_MESSAGE which tells me that MSI is configured on my driver.

I have written the code to configure the interrupt object in AddDevice routine.
I am getting interrupts properly when i configure line based interrupts. So there is nothing wrong with enabling interrupts on the controller.

However i am not receiving any interrupt when i configure the controller for MSI interrupt. Also i am getting 0 for u.MessageInterrupt.Raw.MessageCount.

  1. My system has a few other devices which are configured for MSI. Each device is requesting multiple MSI messages. Is it because there are no more MSI resources left in the system that my driver is getting u.MessageInterrupt.Raw.MessageCount. as 0? Does it help to disable some of the devices and try my device?

  2. Am i missing on any of the registy entries? I am not adding the below entries
    HKR, ?Interrupt Management\Affinity Policy?, 0x00000010
    HKR, ?Interrupt Management\Affinity Policy?, DevicePolicy, 0x00010001, 0x02

Are they mandatory?

What could be the reason that i am not getting any interrupt?

below is the output of teh command
wdfkd.wdfinterrupt for my interrupt object.

Dumping WDFINTERRUPT 0x79f83e98

Interrupt Type: Message-signaled, Connected, Enabled
Message Number: 0
Vector: 0xb4 (!idt 0xb4)
FloatingSave: FALSE
Interrupt Priority Policy: WdfIrqPriorityUndefined
Processor Affinity Policy: WdfIrqPolicyOneCloseProcessor
Processor Group: 0
Processor Affinity: 0xf

dt nt!KINTERRUPT 0x8607c3e8

EvtInterruptIsr: Controllerdriver_MSIEn (0x82804cc0)
EvtInterruptDpc: Controllerdriver_MSIEn (0x82804a40)

Dumping IDT:

b4: 8715e2d8 Wdf01000!FxInterrupt::_InterruptThunk (KINTERRUPT 8715e280)

To get ISR from KINTERRUPT:
dt nt!KINTERRUPT ServiceContext
dt wdf01000!FxInterrupt m_EvtInterruptIsr
lkd> dt nt!KINTERRUPT 0x8607c3e8
Symbol nt!KINTERRUPT not found.
lkd> dt nt!_KINTERRUPT 0x8607c3e8
+0x000 Type : 0n22
+0x002 Size : 0n632
+0x004 InterruptListEntry : _LIST_ENTRY [0x8715e284 - 0x8715e284]
+0x00c ServiceRoutine : 0x8bf2969b unsigned char Wdf01000!FxInterrupt::_InterruptThunk+0
+0x010 MessageServiceRoutine : (null)
+0x014 MessageIndex : 0
+0x018 ServiceContext : 0x8607c160 Void
+0x01c SpinLock : 0
+0x020 TickCount : 0xffffffff
+0x024 ActualLock : 0x8607c1a8 -> 0
+0x028 DispatchAddress : 0x8323be30 void nt!KiInterruptDispatch+0
+0x02c Vector : 0xb4
+0x030 Irql : 0xa ‘’
+0x031 SynchronizeIrql : 0xa ‘’
+0x032 FloatingSave : 0 ‘’
+0x033 Connected : 0x1 ‘’
+0x034 Number : 0
+0x038 ShareVector : 0 ‘’
+0x039 Pad : [3] “”
+0x03c Mode : 1 ( Latched )
+0x040 Polarity : 0 ( InterruptPolarityUnknown )
+0x044 ServiceCount : 0
+0x048 DispatchCount : 0xffffffff
+0x050 Rsvd1 : 0
+0x058 DispatchCode : [135] 0x56535554

I am seeing that the address of MessageServiceRoutine is null. Could this be the problem? If yes, what could be the root cause of this?

I am using KMDF version 1.11. My conistaller name is WdfCoinstaller01011.dll.

is the name Wdf01000!FxInterrupt::_InterruptThunk+0 correct? or should it have been Wdf01011?

The runtime name is wdf01000. If your driver successfully loaded, the minimum minor version was correctly loaded and bound to your driver

d

Bent from my phone


From: xxxxx@gmail.commailto:xxxxx
Sent: ?7/?6/?2014 8:29 AM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: RE:[ntdev] not receiving interrupt when MSI is configured

I am using KMDF version 1.11. My conistaller name is WdfCoinstaller01011.dll.

is the name Wdf01000!FxInterrupt::_InterruptThunk+0 correct? or should it have been Wdf01011?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>

Thanks for the response Doron.

Do you think MessageServiceRoutine being null is a problem?

Or do you think the controller couldn’t be acquire the MSI message?

What could be done at this point to ascertain the root cause of this issue?

Hi,

Did you check that regular interrupts work ?

In my FPGA (ALTERA) we found a BUG that caused legacy interrupts to work and
MSI not.

Did you change inf to support MSI ?

Thanks,
Zvika

-----Original Message-----
From: xxxxx@gmail.com
Sent: Sunday, July 06, 2014 4:23 PM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] not receiving interrupt when MSI is configured

Thanks for the response Doron.

Do you think MessageServiceRoutine being null is a problem?

Or do you think the controller couldn’t be acquire the MSI message?

What could be done at this point to ascertain the root cause of this issue?


NTDEV is sponsored by OSR

Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

I checked for regular Interrupts. They are working fine.
I enabled msi through the .inf file. My controllers configuration space
shows that msi interrupts are configured.
On Sunday, July 6, 2014, Zvi Vered wrote:

> Hi,
>
> Did you check that regular interrupts work ?
>
> In my FPGA (ALTERA) we found a BUG that caused legacy interrupts to work
> and MSI not.
>
> Did you change inf to support MSI ?
>
> Thanks,
> Zvika
>
>
> -----Original Message----- From: xxxxx@gmail.com
> Sent: Sunday, July 06, 2014 4:23 PM
> To: Windows System Software Devs Interest List
> Subject: RE:[ntdev] not receiving interrupt when MSI is configured
>
> Thanks for the response Doron.
>
> Do you think MessageServiceRoutine being null is a problem?
>
> Or do you think the controller couldn’t be acquire the MSI message?
>
> What could be done at this point to ascertain the root cause of this issue?
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


J.S.R.Sarma.
9916109893.

I am planning to check that. However I would like to rule out any
possibility of an issue from the driver side first.

Can I be sure that apart from the registry entries in the .inf file, I
don’t need to make any code changes in the driver to get the MSI interrupts
configured? Mine is WDF driver by the way.

I can’t understand why I am getting message count as 0. What could be done
to resolve this?

On Monday, July 7, 2014, 张枕书 wrote:

> I suggest you make some debug from hardware first, you must make sure
> that HW is really triggering MSI interrupt.
>
> Sent from Windows Mail
>
> From: jayanth sharma
> <javascript:_e>
> Sent: ‎Monday‎, ‎July‎ ‎7‎, ‎2014 ‎12‎:‎30‎ ‎AM
> To: Windows System Software Devs Interest List
> <javascript:_e>
>
>
> I checked for regular Interrupts. They are working fine.
> I enabled msi through the .inf file. My controllers configuration space
> shows that msi interrupts are configured.
> On Sunday, July 6, 2014, Zvi Vered > <javascript:_e>> wrote:
>
>> Hi,
>>
>> Did you check that regular interrupts work ?
>>
>> In my FPGA (ALTERA) we found a BUG that caused legacy interrupts to work
>> and MSI not.
>>
>> Did you change inf to support MSI ?
>>
>> Thanks,
>> Zvika
>>
>>
>> -----Original Message----- From: xxxxx@gmail.com
>> Sent: Sunday, July 06, 2014 4:23 PM
>> To: Windows System Software Devs Interest List
>> Subject: RE:[ntdev] not receiving interrupt when MSI is configured
>>
>> Thanks for the response Doron.
>>
>> Do you think MessageServiceRoutine being null is a problem?
>>
>> Or do you think the controller couldn’t be acquire the MSI message?
>>
>> What could be done at this point to ascertain the root cause of this
>> issue?
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
>
> –
> J.S.R.Sarma.
> 9916109893.
>
> — NTDEV is sponsored by OSR Visit the list at:
> http://www.osronline.com/showlists.cfm?list=ntdev OSR is HIRING!! See
> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list at: http://www.osronline.com/showlists.cfm?list=ntdev
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


J.S.R.Sarma.
9916109893.</javascript:_e></javascript:_e></javascript:_e>

Correct. You have a single MSI interrupt, you should be fine. No code changes are required.

Your WDFINTERRUPT looks correct to me… I vote for hardware problem, like Mr. Vered suggested. I don’t suppose you have a PCIe bus analyzer. Expensive, but darn useful little item. It *really* makes life easier for driver developers. Anyhow, lacking that, SignalTap or ChipScope (depending on your FPGA) might tell you what you want to know.

As several of us have remarked here recently, it is becoming increasingly common to find ugly problems in various FPGA PCIe interface “IP” blocks. So, don’t think that the problem CAN’T be hardware… it certainly could be these days (when hardware, really, is mostly software).

Peter
OSR