Skip to content

Commit d5dea7d

Browse files
ebiedermjbarnes993
authored andcommitted
PCI: msi: Disable msi interrupts when we initialize a pci device
I traced a nasty kexec on panic boot failure to the fact that we had screaming msi interrupts and we were not disabling the msi messages at kernel startup. The booting kernel had not enabled those interupts so was not prepared to handle them. I can see no reason why we would ever want to leave the msi interrupts enabled at boot if something else has enabled those interrupts. The pci spec specifies that msi interrupts should be off by default. Drivers are expected to enable the msi interrupts if they want to use them. Our interrupt handling code reprograms the interrupt handlers at boot and will not be be able to do anything useful with an unexpected interrupt. This patch applies cleanly all of the way back to 2.6.32 where I noticed the problem. Cc: [email protected] Signed-off-by: Eric W. Biederman <[email protected]> Signed-off-by: Jesse Barnes <[email protected]>
1 parent 4716a45 commit d5dea7d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

drivers/pci/msi.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,5 +981,15 @@ EXPORT_SYMBOL(pci_msi_enabled);
981981

982982
void pci_msi_init_pci_dev(struct pci_dev *dev)
983983
{
984+
int pos;
984985
INIT_LIST_HEAD(&dev->msi_list);
986+
987+
/* Disable the msi hardware to avoid screaming interrupts
988+
* during boot. This is the power on reset default so
989+
* usually this should be a noop.
990+
*/
991+
pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
992+
if (pos)
993+
msi_set_enable(dev, pos, 0);
994+
msix_set_enable(dev, 0);
985995
}

0 commit comments

Comments
 (0)