Revert "PCI/MSI: Mask MSI-X vectors only on success"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2022-03-07 16:53:13 +01:00
parent 95f0dbdf95
commit 0cc6238b6a

View File

@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
Date: Mon, 7 Mar 2022 16:51:37 +0100
Subject: [PATCH] Revert "PCI/MSI: Mask MSI-X vectors only on success"
see https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1961968
This reverts commit a7265641d09de8a5eb3ae0ce25a7d14cc6a44da1.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
drivers/pci/msi.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 155bd207b2e6..6166415faf2f 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -821,6 +821,9 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
goto out_disable;
}
+ /* 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_disable;
@@ -843,16 +846,6 @@ 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);