diff options
-rw-r--r-- | drivers/acpi/pci_root.c | 2 | ||||
-rw-r--r-- | drivers/pci/msi.c | 31 | ||||
-rw-r--r-- | drivers/pci/pci.c | 2 | ||||
-rw-r--r-- | drivers/pci/pci.h | 2 | ||||
-rw-r--r-- | include/linux/pci.h | 5 |
5 files changed, 18 insertions, 24 deletions
diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c index 9fe026b1c9d0..5b38a026d122 100644 --- a/drivers/acpi/pci_root.c +++ b/drivers/acpi/pci_root.c | |||
@@ -350,6 +350,8 @@ static int __devinit acpi_pci_root_add(struct acpi_device *device) | |||
350 | if (pcie_aspm_enabled()) | 350 | if (pcie_aspm_enabled()) |
351 | flags |= OSC_ACTIVE_STATE_PWR_SUPPORT | | 351 | flags |= OSC_ACTIVE_STATE_PWR_SUPPORT | |
352 | OSC_CLOCK_PWR_CAPABILITY_SUPPORT; | 352 | OSC_CLOCK_PWR_CAPABILITY_SUPPORT; |
353 | if (pci_msi_enabled()) | ||
354 | flags |= OSC_MSI_SUPPORT; | ||
353 | if (flags != base_flags) | 355 | if (flags != base_flags) |
354 | pci_acpi_osc_support(device->handle, flags); | 356 | pci_acpi_osc_support(device->handle, flags); |
355 | 357 | ||
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 11a51f8ed3b3..b4a90badd0a6 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -776,28 +776,19 @@ void pci_no_msi(void) | |||
776 | pci_msi_enable = 0; | 776 | pci_msi_enable = 0; |
777 | } | 777 | } |
778 | 778 | ||
779 | void pci_msi_init_pci_dev(struct pci_dev *dev) | 779 | /** |
780 | { | 780 | * pci_msi_enabled - is MSI enabled? |
781 | INIT_LIST_HEAD(&dev->msi_list); | 781 | * |
782 | } | 782 | * Returns true if MSI has not been disabled by the command-line option |
783 | 783 | * pci=nomsi. | |
784 | #ifdef CONFIG_ACPI | 784 | **/ |
785 | #include <linux/acpi.h> | 785 | int pci_msi_enabled(void) |
786 | #include <linux/pci-acpi.h> | ||
787 | static void __devinit msi_acpi_init(void) | ||
788 | { | 786 | { |
789 | if (acpi_pci_disabled) | 787 | return pci_msi_enable; |
790 | return; | ||
791 | pci_osc_support_set(OSC_MSI_SUPPORT); | ||
792 | pcie_osc_support_set(OSC_MSI_SUPPORT); | ||
793 | } | 788 | } |
794 | #else | 789 | EXPORT_SYMBOL(pci_msi_enabled); |
795 | static inline void msi_acpi_init(void) { } | ||
796 | #endif /* CONFIG_ACPI */ | ||
797 | 790 | ||
798 | void __devinit msi_init(void) | 791 | void pci_msi_init_pci_dev(struct pci_dev *dev) |
799 | { | 792 | { |
800 | if (!pci_msi_enable) | 793 | INIT_LIST_HEAD(&dev->msi_list); |
801 | return; | ||
802 | msi_acpi_init(); | ||
803 | } | 794 | } |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 48fa860276d4..2cfa41e367a7 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -2105,8 +2105,6 @@ static int __devinit pci_init(void) | |||
2105 | pci_fixup_device(pci_fixup_final, dev); | 2105 | pci_fixup_device(pci_fixup_final, dev); |
2106 | } | 2106 | } |
2107 | 2107 | ||
2108 | msi_init(); | ||
2109 | |||
2110 | return 0; | 2108 | return 0; |
2111 | } | 2109 | } |
2112 | 2110 | ||
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index d3e65e29df51..9162e242b99e 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -102,11 +102,9 @@ extern unsigned int pci_pm_d3_delay; | |||
102 | #ifdef CONFIG_PCI_MSI | 102 | #ifdef CONFIG_PCI_MSI |
103 | void pci_no_msi(void); | 103 | void pci_no_msi(void); |
104 | extern void pci_msi_init_pci_dev(struct pci_dev *dev); | 104 | extern void pci_msi_init_pci_dev(struct pci_dev *dev); |
105 | extern void __devinit msi_init(void); | ||
106 | #else | 105 | #else |
107 | static inline void pci_no_msi(void) { } | 106 | static inline void pci_no_msi(void) { } |
108 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } | 107 | static inline void pci_msi_init_pci_dev(struct pci_dev *dev) { } |
109 | static inline void msi_init(void) { } | ||
110 | #endif | 108 | #endif |
111 | 109 | ||
112 | #ifdef CONFIG_PCIEAER | 110 | #ifdef CONFIG_PCIEAER |
diff --git a/include/linux/pci.h b/include/linux/pci.h index eae97a2bf603..59a3dc2059d3 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -779,6 +779,10 @@ static inline void msi_remove_pci_irq_vectors(struct pci_dev *dev) | |||
779 | 779 | ||
780 | static inline void pci_restore_msi_state(struct pci_dev *dev) | 780 | static inline void pci_restore_msi_state(struct pci_dev *dev) |
781 | { } | 781 | { } |
782 | static inline int pci_msi_enabled(void) | ||
783 | { | ||
784 | return 0; | ||
785 | } | ||
782 | #else | 786 | #else |
783 | extern int pci_enable_msi(struct pci_dev *dev); | 787 | extern int pci_enable_msi(struct pci_dev *dev); |
784 | extern void pci_msi_shutdown(struct pci_dev *dev); | 788 | extern void pci_msi_shutdown(struct pci_dev *dev); |
@@ -789,6 +793,7 @@ extern void pci_msix_shutdown(struct pci_dev *dev); | |||
789 | extern void pci_disable_msix(struct pci_dev *dev); | 793 | extern void pci_disable_msix(struct pci_dev *dev); |
790 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 794 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
791 | extern void pci_restore_msi_state(struct pci_dev *dev); | 795 | extern void pci_restore_msi_state(struct pci_dev *dev); |
796 | extern int pci_msi_enabled(void); | ||
792 | #endif | 797 | #endif |
793 | 798 | ||
794 | #ifndef CONFIG_PCIEASPM | 799 | #ifndef CONFIG_PCIEASPM |