aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2011-10-17 11:46:06 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-25 17:24:38 -0800
commit65d61b46700e059210b4c9f63355d57dc0e1a18e (patch)
tree3fd6a4eaf1de233c65246fc4577787246da27a3b /drivers/pci
parent58f98e86f9138e283b98766541727af91a58e849 (diff)
downloadkernel_samsung_smdk4412-65d61b46700e059210b4c9f63355d57dc0e1a18e.zip
kernel_samsung_smdk4412-65d61b46700e059210b4c9f63355d57dc0e1a18e.tar.gz
kernel_samsung_smdk4412-65d61b46700e059210b4c9f63355d57dc0e1a18e.tar.bz2
PCI: msi: Disable msi interrupts when we initialize a pci device
commit a776c491ca5e38c26d9f66923ff574d041e747f4 upstream. 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. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/msi.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 2f10328..e174982 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -869,5 +869,15 @@ EXPORT_SYMBOL(pci_msi_enabled);
void pci_msi_init_pci_dev(struct pci_dev *dev)
{
+ int pos;
INIT_LIST_HEAD(&dev->msi_list);
+
+ /* Disable the msi hardware to avoid screaming interrupts
+ * during boot. This is the power on reset default so
+ * usually this should be a noop.
+ */
+ pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
+ if (pos)
+ msi_set_enable(dev, pos, 0);
+ msix_set_enable(dev, 0);
}