Using pci_enable_msi_block

I am trying to include multiple IRQ lines in a kernel module. I work in RC mode. The problem is that when called, pci_enable_msi_block()it will not allocate more than 1 MSI. If I call pci_enable_msi_block(dev, 32), it will return 4 (which, I suppose, should mean that I can use 4 MSI). Then I call pci_enable_msi_block(dev,4)and it returns 1.

Here is the result from $lspci -vafter insmod Custom_module.ko, but only with the successful inclusion of 1 MSI

00:00.0 PCI bridge: Texas Instruments Device 8888 (rev 01) (prog-if 00 [Normal decode])
    Flags: bus master, fast devsel, latency 0
    Memory at <ignored> (32-bit, non-prefetchable)
    Memory at <ignored> (32-bit, prefetchable)
    Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
    I/O behind bridge: 00001000-00001fff
    Memory behind bridge: 50000000-501fffff
    Prefetchable memory behind bridge: 50200000-503fffff
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [70] Express Root Port (Slot-), MSI 00
    Capabilities: [100] Advanced Error Reporting
    Kernel driver in use: pcieport

01:00.0 Memory controller: Xilinx Corporation Device 7022
    Subsystem: Xilinx Corporation Device 0007
    Flags: bus master, fast devsel, latency 0, IRQ 576
    Memory at 50000000 (32-bit, non-prefetchable) [size=1M]
    Capabilities: [80] Power Management version 3
    Capabilities: [90] MSI: Enable+ Count=4/4 Maskable- 64bit+
    Capabilities: [c0] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Kernel driver in use: Custom_Module

How can I use more than 1 MSI. I can use JTAG to edit the Enable_MSI registers, and then the EP can initiate the MSI, but there is no handler for these IRQs.

+1
source share

All Articles