https://elixir.bootlin.com/linux/latest/source/drivers/pci/msi.c#L1130
-In the above link, I see that pci_enable_msi function is deprecated, but I can still call it successfully in my driver. Why is it deprecated? What is a good replacement?
https://elixir.bootlin.com/linux/latest/source/drivers/pci/msi.c#L1130
-In the above link, I see that pci_enable_msi function is deprecated, but I can still call it successfully in my driver. Why is it deprecated? What is a good replacement?
From the MSI Driver Guide HOWTO:
Most of the hard work is done for the driver in the PCI layer. The driver simply has to request that the PCI layer set up the MSI capability for this device.
To automatically use MSI or MSI-X interrupt vectors, use the following function:
int pci_alloc_irq_vectors(struct pci_dev *dev, unsigned int min_vecs, unsigned int max_vecs, unsigned int flags);
Looking at the source we can see pci_enable_msi calls __pci_enable_msi_range(dev, 1, 1, NULL) (see here).
This same function is called in pci_alloc_irq_vectors and pci_alloc_irq_vectors_affinity (see here and here).