]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - glsdk/meta-ti-glsdk.git/blob - recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0032-PCI-msi-Disable-msi-interrupts-when-we-initialize-a-.patch
linux-ti335x-psp 3.2: update to v3.2.11
[glsdk/meta-ti-glsdk.git] / recipes-kernel / linux / linux-ti33x-psp-3.2 / 3.2.2 / 0032-PCI-msi-Disable-msi-interrupts-when-we-initialize-a-.patch
1 From 5b5be8901badfd9baec5d13fec6be5c942f2bf71 Mon Sep 17 00:00:00 2001
2 From: "Eric W. Biederman" <ebiederm@xmission.com>
3 Date: Mon, 17 Oct 2011 11:46:06 -0700
4 Subject: [PATCH 032/130] PCI: msi: Disable msi interrupts when we initialize
5  a pci device
7 commit a776c491ca5e38c26d9f66923ff574d041e747f4 upstream.
9 I traced a nasty kexec on panic boot failure to the fact that we had
10 screaming msi interrupts and we were not disabling the msi messages at
11 kernel startup.  The booting kernel had not enabled those interupts so
12 was not prepared to handle them.
14 I can see no reason why we would ever want to leave the msi interrupts
15 enabled at boot if something else has enabled those interrupts.  The pci
16 spec specifies that msi interrupts should be off by default.  Drivers
17 are expected to enable the msi interrupts if they want to use them.  Our
18 interrupt handling code reprograms the interrupt handlers at boot and
19 will not be be able to do anything useful with an unexpected interrupt.
21 This patch applies cleanly all of the way back to 2.6.32 where I noticed
22 the problem.
24 Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
25 Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
26 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
27 ---
28  drivers/pci/msi.c |   10 ++++++++++
29  1 file changed, 10 insertions(+)
31 diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
32 index 0e6d04d..e3efb43 100644
33 --- a/drivers/pci/msi.c
34 +++ b/drivers/pci/msi.c
35 @@ -870,5 +870,15 @@ EXPORT_SYMBOL(pci_msi_enabled);
36  
37  void pci_msi_init_pci_dev(struct pci_dev *dev)
38  {
39 +       int pos;
40         INIT_LIST_HEAD(&dev->msi_list);
41 +
42 +       /* Disable the msi hardware to avoid screaming interrupts
43 +        * during boot.  This is the power on reset default so
44 +        * usually this should be a noop.
45 +        */
46 +       pos = pci_find_capability(dev, PCI_CAP_ID_MSI);
47 +       if (pos)
48 +               msi_set_enable(dev, pos, 0);
49 +       msix_set_enable(dev, 0);
50  }
51 -- 
52 1.7.9.4