I am using the hardknott 5.10.35 linux release of Yocto for an i.MX8MPlus EVK board. The Linux driver for PCIe being loaded is the imx6q-pcie driver. Using this driver, MSI support gets disabled during the boot process. Is there an updated driver from NXP that supports the newer hardware, including MSI, that can be used? Here is some of the console output:
Model: NXP i.MX8MPlus LPDDR4 EVK board
[ 0.110491] imx8mp-pinctrl 30330000.pinctrl: initialized IMX pinctrl driver
[ 1.987530] i2c i2c-2: IMX I2C adapter registered
[ 1.994341] imx8mq-usb-phy 381f0040.usb-phy: supply vbus not found, using dummy regulator
[ 2.003041] imx8mq-usb-phy 382f0040.usb-phy: supply vbus not found, using dummy regulator
[ 2.222849] imx6q-pcie 33800000.pcie: Link up
[ 2.231110] imx6q-pcie 33800000.pcie: Link up, Gen1
[ 2.236093] imx6q-pcie 33800000.pcie: PCI host bridge to bus 0000:00
[ 2.242453] pci_bus 0000:00: root bus resource [bus 00-ff]
[ 2.247943] pci_bus 0000:00: root bus resource [io 0x0000-0xffff]
[ 2.254128] pci_bus 0000:00: root bus resource [mem 0x18000000-0x1fefffff]
[ 2.261034] pci 0000:00:00.0: [16c3:abcd] type 01 class 0x060400
[ 2.261047] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x000fffff]
[ 2.273317] pci 0000:00:00.0: reg 0x38: [mem 0x00000000-0x0000ffff pref]
[ 2.280055] pci 0000:00:00.0: supports D1
[ 2.284068] pci 0000:00:00.0: PME# supported from D0 D1 D3hot D3cold
[ 2.292705] pci 0000:01:00.0: MSI quirk detected; MSI disabled
I have found that for this board (i.MX8MPlus EVK) the PCIe driver that deals with the M.2 PCIe port on the back of the board is called 'pci-imx6.c', and that the corresponding host PCIe driver is 'pcie-designware-host.c'. I am porting a Qualcomm PCIe wifi driver to this platform. The wifi driver is designed to use 32 MSI interrupts. (As the PCI bus gets probed, 1 MSI interrupt is assigned.) When the wifi driver starts to load, it asks for 32 MSIs, but it fails. (The function 'dw_pcie_host_init' in the designware driver sets the number MSIs to 32 by default. The pci-imx6 driver does not have a 'set_num_vectors' function for the pcie_port ops to set the value differently.) I am guessing since the driver asks for 32 MSIs, and the pcie driver only has 31 available, the request for 32 fails.
So the question is, can the i.mx8mp-evk board M.2 PCIe fabric and drivers handle more than 32 MSIs? If I create an ops function for the pcie_port device that will set_num_vectors to 64, will that cause problems? (A macro 'MAX_MSI_IRQS' is set at 256, so 64 seems doable.)
The wcn685x PCIe device does not trigger a quirk that disables MSI for the system. That is good that the platform doesn't have this particular issue.
Now on to porting the wcn685x Qualcomm driver and it's dependent cnss platform driver ...
Thanks for the feedback, Igor. I am working with Linux 5.10.35. Do you have something that applies to that a little easier?
The main problem I am having is with obtaining 32 MSIs. I used the kernel function 'pci_msi_vec_count' to see how many MSIs are available. It returns 32. But the call to 'pci_alloc_irq_vectors' only returns 1.
Here is my source for the function call:
num_vectors = pci_alloc_irq_vectors(pci_dev, 1, msi_config->total_vectors, PCI_IRQ_MSI | PCI_IRQ_MSIX);
And here is my .config file, at the IRQ subsystem:
# IRQ subsystem
And the config file at the device drivers area:
And the config at PCI controller drivers:
Perhaps the disabled MSI is due to the following from kernel source: ./drivers/pci/quirks.c:
DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_MARVELL_EXT, 0x2b42, quirk_disable_all_msi);
01:00.0 Class 0200: 1b4b:2b42
00:00.0 Class 0604: 16c3:abcd
The PCIe device being registered is a Marvell 0x2b42 device, which appears to be declared as having a quirk to the extent that MSI for all PCIe is disabled.
Which may mean that a different PCIe device won't end up with the same disabling MSI.
I'll try a Qualcomm wcn685x PCIe radio and see if the same disabling of MSI happens.