aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/msi
diff options
context:
space:
mode:
authorThomas Gleixner2021-12-14 13:30:34 +0100
committerThomas Gleixner2021-12-14 13:30:34 +0100
commit09eb3ad55fef8d62edb74d5fe3a6720b6b467463 (patch)
treeea7effcf055b12be234d0992110e464aa307520d /drivers/pci/msi
parent60bf9b33c82c0e040a98272d7ff4f5a52e7469d6 (diff)
parent94185adbfad56815c2c8401e16d81bdb74a79201 (diff)
Merge branch 'irq/urgent' into irq/msi
to pick up the PCI/MSI-x fixes. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/pci/msi')
-rw-r--r--drivers/pci/msi/msi.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
index 8b4d529792a6..eb917fecf3cf 100644
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -600,9 +600,6 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
dev->msix_base = base;
- /* Ensure that all table entries are masked. */
- msix_mask_all(base, tsize);
-
ret = msix_setup_entries(dev, base, entries, nvec, affd);
if (ret)
goto out_free;
@@ -629,6 +626,16 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
/* Set MSI-X enabled bits and unmask the function */
pci_intx_for_msi(dev, 0);
dev->msix_enabled = 1;
+
+ /*
+ * Ensure that all table entries are masked to prevent
+ * stale entries from firing in a crash kernel.
+ *
+ * Done late to deal with a broken Marvell NVME device
+ * which takes the MSI-X mask bits into account even
+ * when MSI-X is disabled, which prevents MSI delivery.
+ */
+ msix_mask_all(base, tsize);
pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL, 0);
pcibios_free_irq(dev);
@@ -638,7 +645,7 @@ out_free:
free_msi_irqs(dev);
out_disable:
- pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);
+ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0);
return ret;
}