0

I'm trying to get MSI-X working on an iMX6 (Freescale/NXP/Qualcomm) CPU in Linux v4.1 for a PCIe character device driver. Whenever I call either pci_enable_msix() or pci_enable_msix_range() or pci_enable_msix_exact() I get an EINVAL value returned. I do have the CONFIG_PCI_MSI option selected in the kernel configuration and I am also able to get single MSI working with pci_enable_msi(), but I cannot get multiple MSI working either.

I have tested my driver code on an Intel i7 running kernel v3 with the same PCIe hardware attached and I was able to get MSI-X working without any problems so I know my code is correctly written and the hardware is correctly functioning.

When running on the iMX6 I can use lspci -v to view that the hardware has MSI-X capabilities and see the number of IRQs it allows. I can even get the same correct number in my driver when calling pci_msix_vec_count().

Questions

  1. Are there any other kernel configuration flags I need to set?
  2. Is there anything specific to the iMX6 CPU I need to consider?
  3. Does anyone have any experience with the iMX6 and either MSI-X or multiple MSI?
user2205930
  • 1,046
  • 12
  • 26
  • I did check `dev->bus->msi` and it is null. I found this from digging through the kernel code. But I am able to get single MSI to work which. – user2205930 Sep 30 '17 at 13:26
  • I won't be able to check this until I get back into the office but if I call `pci_enable_msi()` instead of `pci_enable_msix()` I do get a single MSI to work, this has been tested and my ISR is able to fire upon receiving the single MSI. Maybe my brain is fixating on the wrong thing here, I will check your suggestion once I get the chance. Thank you. – user2205930 Sep 30 '17 at 14:09
  • @BronislavElizavetin, please, do use new API for the IRQ allocation in PCI drivers. `pci_alloc_irq_vectors()` et al. An example http://elixir.free-electrons.com/linux/latest/source/drivers/thunderbolt/nhi.c#L728. – 0andriy Oct 01 '17 at 19:08
  • According to the patch history `pci_alloc_irq_vectors()` didn't take effect until kernel v4.9, I'm currently using v4.1. If my code compiles doesn't that mean that functions like `pci_enable_msix_range()` are still valid? – user2205930 Oct 01 '17 at 19:13
  • Ah, in your case you stuck with old API, indeed. – 0andriy Oct 01 '17 at 19:14
  • I'm on an embedded system so I am at the mercy of the chip developers when it comes to kernel versions. – user2205930 Oct 01 '17 at 19:15

0 Answers0