2

I am trying to enable multiple MSI irq lines in a kernel module. I am operating in RC mode. The problem is when I call 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 assume should mean I can use 4 MSI). I then call pci_enable_msi_block(dev,4) and it returns 1.

Here is an output from $lspci -v after insmod Custom_module.ko but with only a successful enable 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 do I go about using more than 1 MSI. I can use JTAG to edit the Enable_MSI registers and then the EP can trigger the MSI, but there is no handler dedicated to these IRQs.

whh4000
  • 905
  • 1
  • 12
  • 30
  • Are you calling pci_enable_msi_block twice? Are you sure that your bridge supports Multiple MSI? – Claudio Jun 21 '14 at 05:24
  • @Claudio pci_enable_msi_block() is supposed to be called multiple times. MSI messages are normal memory accesses; bridges do not need any special support for them. – CL. Jun 21 '14 at 08:53
  • This is one of those embedded devices with a vendor-specific kernel, isn't it? – CL. Jun 21 '14 at 08:58
  • Yes it runs a TI managed Kernel which is based off of the Yocto project (Arago). It still confuses me why it would return 4 and then when I `pci_enable_msi_block` a secondtime asking for 4 MSI, it returns 1. – whh4000 Jun 23 '14 at 11:59

0 Answers0