]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/suse-2.6.27.39/patches.drivers/acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch
Imported linux-2.6.27.39 suse/xen patches.
[ipfire-2.x.git] / src / patches / suse-2.6.27.39 / patches.drivers / acpi-pci-pci-msi-_osc-support-capabilities-called-when-root-bridge-added.patch
CommitLineData
2cb7cef9
BS
1From 07ae95f988a34465bdcb384bfa73c03424fe2312 Mon Sep 17 00:00:00 2001
2From: Andrew Patterson <andrew.patterson@hp.com>
3Date: Mon, 10 Nov 2008 15:31:05 -0700
4Subject: ACPI/PCI: PCI MSI _OSC support capabilities called when root bridge added
5Patch-mainline: 2.6.29
6References: bnc#438941
7
8The _OSC capability OSC_MSI_SUPPORT is set when the root bridge is added
9with pci_acpi_osc_support(), so we no longer need to do it in the PCI
10MSI driver. Also adds the function pci_msi_enabled, which returns true
11if pci=nomsi is not on the kernel command-line.
12
13Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
14Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
15Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16
17---
18 drivers/acpi/pci_root.c | 2 ++
19 drivers/pci/msi.c | 11 +++++++++++
20 include/linux/pci.h | 7 +++++++
21 3 files changed, 20 insertions(+)
22
23--- a/drivers/acpi/pci_root.c
24+++ b/drivers/acpi/pci_root.c
25@@ -350,6 +350,8 @@ static int __devinit acpi_pci_root_add(s
26 if (pcie_aspm_enabled())
27 flags |= OSC_ACTIVE_STATE_PWR_SUPPORT |
28 OSC_CLOCK_PWR_CAPABILITY_SUPPORT;
29+ if (pci_msi_enabled())
30+ flags |= OSC_MSI_SUPPORT;
31 if (flags != base_flags)
32 pci_acpi_osc_support(device->handle, flags);
33
34--- a/drivers/pci/msi.c
35+++ b/drivers/pci/msi.c
36@@ -757,6 +757,17 @@ void pci_no_msi(void)
37 pci_msi_enable = 0;
38 }
39
40+/**
41+ * pci_msi_enabled - is MSI enabled?
42+ *
43+ * Returns true if MSI has not been disabled by the command-line option
44+ * pci=nomsi.
45+ **/
46+int pci_msi_enabled(void)
47+{
48+ return pci_msi_enable;
49+}
50+
51 void pci_msi_init_pci_dev(struct pci_dev *dev)
52 {
53 INIT_LIST_HEAD(&dev->msi_list);
54--- a/include/linux/pci.h
55+++ b/include/linux/pci.h
56@@ -767,6 +767,11 @@ static inline void msi_remove_pci_irq_ve
57
58 static inline void pci_restore_msi_state(struct pci_dev *dev)
59 { }
60+
61+static inline int pci_msi_enabled(void)
62+{
63+ return 0;
64+}
65 #else
66 extern int pci_enable_msi(struct pci_dev *dev);
67 extern void pci_msi_shutdown(struct pci_dev *dev);
68@@ -777,6 +782,8 @@ extern void pci_msix_shutdown(struct pci
69 extern void pci_disable_msix(struct pci_dev *dev);
70 extern void msi_remove_pci_irq_vectors(struct pci_dev *dev);
71 extern void pci_restore_msi_state(struct pci_dev *dev);
72+extern int pci_msi_enabled(void);
73+
74 #endif
75
76 #ifndef CONFIG_PCIEASPM