1 // SPDX-License-Identifier: GPL-2.0
3 * MSI[X} related functions which are available unconditionally.
8 * Disable the MSI[X] hardware to avoid screaming interrupts during boot.
9 * This is the power on reset default so usually this should be a noop.
12 void pci_msi_init(struct pci_dev *dev)
16 dev->msi_cap = pci_find_capability(dev, PCI_CAP_ID_MSI);
20 pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &ctrl);
21 if (ctrl & PCI_MSI_FLAGS_ENABLE) {
22 pci_write_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS,
23 ctrl & ~PCI_MSI_FLAGS_ENABLE);
26 if (!(ctrl & PCI_MSI_FLAGS_64BIT))
27 dev->no_64bit_msi = 1;
30 void pci_msix_init(struct pci_dev *dev)
34 dev->msix_cap = pci_find_capability(dev, PCI_CAP_ID_MSIX);
38 pci_read_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, &ctrl);
39 if (ctrl & PCI_MSIX_FLAGS_ENABLE) {
40 pci_write_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS,
41 ctrl & ~PCI_MSIX_FLAGS_ENABLE);