Issues with MSI(x) handling

I've a basic IOPCIDevice driver for a custom device that supports MSI(x). The interrupt filter doesn't get called if I pass
the msi index to the IOFilterInterruptEventSource. That's a first problem.


The filter is continously called if I don't pass the msi index. That's a 2nd problem.


Interrupt was triggered when I initialized the device. In the filter I cleared the cause register. For some reason
intr mask register was already cleared when the filter is called which is another problem.

Any clues/pointers?

bump


Anyone?

My recommendation here is that you open a DTS tech support incident and talk to our I/O Kit specialist about this.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"


WWDC runs Mon, 4 Jun through to Fri, 8 Jun. During that time all of DTS will be at the conference, helping folks out face-to-face.

I discovered few issues with MSI-x handling in the IOPCIFamily.


It looks like although the IOPCIMessagedInterruptController is allocating multiple sub-vectors per device (if the device supports many), then it can handle only one of them.

Whenever the MSI-x is received, the IOPCIMessagedInterruptController is calling only handler for the subvector[0] and that's only the case if the single interrupt is configured. If you will configure more than one MSI-x for the device, it will try to resolve PBA for the source of the interrupt but PBA will be probably whole filled with 0 because interrupts will be unmasked.


I don't know why the message data from the vector table is not being passed to the interrupt handler and they are not checking it to resolve interrupt source.


The reason why the handler is continously called, is because the handler of subvector[0] is called for every subvector, so if your device is supporting 32 MSI-x vetors, then it will be called for 32 times each time the interrupt is received.


If you will try to assign handler to for example, subvector[3] and you will have only single MSI-x configured, then the handler won't be executed at all, because only subvector[0] handler is called in that situation.

Issues with MSI(x) handling
 
 
Q