How MSI address register get initialized in PCIe devices?

Hi all,
I am writing a Windows driver in KMDF (windows 7, 64 bit) . We are using Altera hard IP for PCIe 11.0 version ( Stratix 1V ) . In that we are facing some issues with
MSI generation of PCIe.

In MSI capability register, there are 2 fields. MSI Address and MSI data. These fields should be initialized during the installation time of the function driver. But these fields are not initialized in our device.
We suspect that we are doing something wrong in the PCI configuration space. In particular, at offset “3C” in the configuration space, the field named “Interrupt Pin” value is 1.
Please clarify what should be the value for “Interrupt Pin” when we are using MSI.

You need to correctly declare in the INF that you require MSI.
Otherwise it won’t be assigned to the device.
See here:
http://msdn.microsoft.com/en-us/library/windows/hardware/ff544246(v=vs.85).aspx

–pa

On 16-Oct-2012 13:06, xxxxx@tataelxsi.co.in wrote:

Hi all,
I am writing a Windows driver in KMDF (windows 7, 64 bit) . We are using Altera hard IP for PCIe 11.0 version ( Stratix 1V ) . In that we are facing some issues with
MSI generation of PCIe.

In MSI capability register, there are 2 fields. MSI Address and MSI data. These fields should be initialized during the installation time of the function driver. But these fields are not initialized in our device.
We suspect that we are doing something wrong in the PCI configuration space. In particular, at offset “3C” in the configuration space, the field named “Interrupt Pin” value is 1.
Please clarify what should be the value for “Interrupt Pin” when we are using MSI.

xxxxx@tataelxsi.co.in wrote:

I am writing a Windows driver in KMDF (windows 7, 64 bit) . We are using Altera hard IP for PCIe 11.0 version ( Stratix 1V ) . In that we are facing some issues with MSI generation of PCIe.

In MSI capability register, there are 2 fields. MSI Address and MSI data. These fields should be initialized during the installation time of the function driver. But these fields are not initialized in our device.
We suspect that we are doing something wrong in the PCI configuration space. In particular, at offset “3C” in the configuration space, the field named “Interrupt Pin” value is 1.
Please clarify what should be the value for “Interrupt Pin” when we are using MSI.

Setting “Interrupt Pin” to 1 simply means that you support legacy
interrupts as well as MSI. On Windows XP, for example, MSI will be
disabled and you will be assigned an interrupt line.

On Vista and beyond, assuming you have the magic registry entries in
your INF file, you will be assigned an MSI address and the interrupt
line will remain unassigned.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Both Pavel and Tim have made correct statements already. You won’t see your
MSI enabled at all with Windows XP or earlier versions of Windows. But let
me elaborate a little more.

If your device sets Interrupt Pin to some non-zero value, this means that
your device supports line-based interrupts as well as MSI-based interrupts.
Windows will assume that your driver is only prepared to handle the
line-based case, unless you set some registry keys in your INF, attesting
that your driver was written with MSI in mind.

If, however, you don’t support line-based interrupts at all, and only
support MSI, Windows will assume that your driver understands MSI and is
prepared to handle it. In this case, there is no need to set any registry
keys.

Of course, it’s usually a market requirement to support line-based
interrupts, either because you want to run with older versions of Windows or
because your device may be placed into a machine that can’t deliver MSIs to
the processors. (These have gotten much rarer, lately.) Your call, though.

Jake Oshins
Windows Kernel Team

This message offers no warranties and confers no rights.

wrote in message news:xxxxx@ntdev…

Hi all,
I am writing a Windows driver in KMDF (windows 7, 64 bit) . We are using
Altera hard IP for PCIe 11.0 version ( Stratix 1V ) . In that we are facing
some issues with
MSI generation of PCIe.

In MSI capability register, there are 2 fields. MSI Address and MSI data.
These fields should be initialized during the installation time of the
function driver. But these fields are not initialized in our device.
We suspect that we are doing something wrong in the PCI configuration space.
In particular, at offset “3C” in the configuration space, the field named
“Interrupt Pin” value is 1.
Please clarify what should be the value for “Interrupt Pin” when we are
using MSI.

Hi all,

Thanks for the reply.
I have added the following entries in the inf file.

HKR,MSICapablity, 0x00010001, 0x00400000
HKR,MsiNeeded, 0x00010001, 0x04

HKR, ?Interrupt Management?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, MSISupported, 0x00010001, 1
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, MessageNumberLimit, 0x00010001, 8

After doing this my driver’s ISR got called.
But we read the value of the msi capablity structure through “pci scope”.Still the MSI address and data fields are zeros.
Please clarify “why MSI address and data fields are not initialized?”

Thanks,
Arvind

Hi All,

We have observed that “interrupt disable” bit in command register of the pci config space is 0 and “MSI Enable” bit in MSI capality structure is 0.
The address and data fields of MSI capablity structure is 0.
But our ISR got called only for message id 0. For other message ids ISR did not get called.
We are using the following inf entries.

HKR,MSICapablity, 0x00010001, 0x00400000
HKR,MsiNeeded, 0x00010001, 0x04

HKR, ?Interrupt Management?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, MSISupported,
0x00010001, 1
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?,
MessageNumberLimit, 0x00010001, 8

Please clarify “why MSI address and data fields are not initialized?” and “why ISR didnot get called for message ids other than 0 ?”

Thanks,
Arvind

Use StorPortGetMSIInfo function to confirm how many messages has been allocated to your device. This function will return STOR_STATUS_SUCCESS only when a valid msg id is passed.

You can also check the related msg.data and msg.address.

To tell you more, I’d have to debug your system. What I can say for sure is
that you’re ISR is being called because you’re using a line-based interrupt,
not MSI.

Jake Oshins
Windows Kernel Team

This message offers no warranties and confers no rights.

wrote in message news:xxxxx@ntdev…

Hi All,

We have observed that “interrupt disable” bit in command register of the pci
config space is 0 and “MSI Enable” bit in MSI capality structure is 0.
The address and data fields of MSI capablity structure is 0.
But our ISR got called only for message id 0. For other message ids ISR did
not get called.
We are using the following inf entries.

HKR,MSICapablity, 0x00010001, 0x00400000
HKR,MsiNeeded, 0x00010001, 0x04

HKR, ?Interrupt Management?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?,
MSISupported,
0x00010001, 1
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?,
MessageNumberLimit, 0x00010001, 8

Please clarify “why MSI address and data fields are not initialized?” and
“why ISR didnot get called for message ids other than 0 ?”

Thanks,
Arvind

xxxxx@tataelxsi.co.in wrote:

Thanks for the reply.
I have added the following entries in the inf file.

HKR,MSICapablity, 0x00010001, 0x00400000
HKR,MsiNeeded, 0x00010001, 0x04

HKR, ?Interrupt Management?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, MSISupported, 0x00010001, 1
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, MessageNumberLimit, 0x00010001, 8

The ? in there leads me to believe you may have typed this in an editor
that uses typographical double quote marks (the ones that lean left and
right) instead of the simple double quote / inch mark, ASCII 0x22.
Also, there are not enough commas in the first two lines.

It should look exactly like this (the quote marks aren’t needed since
there are no spaces):

HKR, Interrupt Management,0x00000010
HKR, Interrupt Management\MessageSignaledInterruptProperties,0x00000010
HKR, Interrupt
Management\MessageSignaledInterruptProperties,MSISupported,0x00010001,1
HKR, Interrupt
Management\MessageSignaledInterruptProperties,MessageNumberLimit,0x00010001,8


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Yes. And as silly as it may sound, although I actually defined those
registry keys, I was once having trouble remembering them. So I opened up
OSR’s web site and did a copy-and-paste operation from their article on
enabling MSI into a driver’s INF. Of course, OSR’s web formatting engine
had turned the quotation marks into the wrong thing. It took me a while to
understand why it didn’t work.

Jake Oshins
Windows Kernel Team

This message offers no warranties and confers no rights.

“Tim Roberts” wrote in message news:xxxxx@ntdev…

xxxxx@tataelxsi.co.in wrote:

Thanks for the reply.
I have added the following entries in the inf file.

HKR,MSICapablity, 0x00010001, 0x00400000
HKR,MsiNeeded, 0x00010001, 0x04

HKR, ?Interrupt Management?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?, 0x00000010
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?,
MSISupported, 0x00010001, 1
HKR, ?Interrupt Management\MessageSignaledInterruptProperties?,
MessageNumberLimit, 0x00010001, 8

The ? in there leads me to believe you may have typed this in an editor
that uses typographical double quote marks (the ones that lean left and
right) instead of the simple double quote / inch mark, ASCII 0x22.
Also, there are not enough commas in the first two lines.

It should look exactly like this (the quote marks aren’t needed since
there are no spaces):

HKR, Interrupt Management,0x00000010
HKR, Interrupt Management\MessageSignaledInterruptProperties,0x00000010
HKR, Interrupt
Management\MessageSignaledInterruptProperties,MSISupported,0x00010001,1
HKR, Interrupt
Management\MessageSignaledInterruptProperties,MessageNumberLimit,0x00010001,8


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.