Skip to content

Commit 94185ad

Browse files
committed
PCI/MSI: Clear PCI_MSIX_FLAGS_MASKALL on error
PCI_MSIX_FLAGS_MASKALL is set in the MSI-X control register at MSI-X interrupt setup time. It's cleared on success, but the error handling path only clears the PCI_MSIX_FLAGS_ENABLE bit. That's incorrect as the reset state of the PCI_MSIX_FLAGS_MASKALL bit is zero. That can be observed via lspci: Capabilities: [b0] MSI-X: Enable- Count=67 Masked+ Clear the bit in the error path to restore the reset state. Fixes: 4385539 ("PCI/MSI: Enable and mask MSI-X early") Reported-by: Stefan Roese <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Stefan Roese <[email protected]> Cc: [email protected] Cc: Bjorn Helgaas <[email protected]> Cc: Michal Simek <[email protected]> Cc: Marek Vasut <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/87tufevoqx.ffs@tglx
1 parent 83dbf89 commit 94185ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pci/msi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
784784
free_msi_irqs(dev);
785785

786786
out_disable:
787-
pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);
787+
pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0);
788788

789789
return ret;
790790
}

0 commit comments

Comments
 (0)