aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2013-08-09 16:27:06 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:47:18 -0400
commit6f4bb4e63824911a5a820c4f0dae5fafcc8daad1 (patch)
tree425bd6848123ad934845486ea8b43026789c4fdd /arch/x86/kernel
parentdb35409d1027d58f7cf785f077cfb1e11b23d845 (diff)
PCI: use weak functions for MSI arch-specific functions
Until now, the MSI architecture-specific functions could be overloaded using a fairly complex set of #define and compile-time conditionals. In order to prepare for the introduction of the msi_chip infrastructure, it is desirable to switch all those functions to use the 'weak' mechanism. This commit converts all the architectures that were overidding those MSI functions to use the new strategy. Note that we keep two separate, non-weak, functions default_teardown_msi_irqs() and default_restore_msi_irqs() for the default behavior of the arch_teardown_msi_irqs() and arch_restore_msi_irqs(), as the default behavior is needed by x86 PCI code. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Tested-by: Daniel Price <daniel.price@gmail.com> Tested-by: Thierry Reding <thierry.reding@gmail.com> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Cc: linuxppc-dev@lists.ozlabs.org Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: x86@kernel.org Cc: Russell King <linux@arm.linux.org.uk> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: linux-ia64@vger.kernel.org Cc: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Cc: David S. Miller <davem@davemloft.net> Cc: sparclinux@vger.kernel.org Cc: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/x86_init.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
index 45a14dbbddaf..5587f991d111 100644
--- a/arch/x86/kernel/x86_init.c
+++ b/arch/x86/kernel/x86_init.c
@@ -107,6 +107,8 @@ struct x86_platform_ops x86_platform = {
107}; 107};
108 108
109EXPORT_SYMBOL_GPL(x86_platform); 109EXPORT_SYMBOL_GPL(x86_platform);
110
111#if defined(CONFIG_PCI_MSI)
110struct x86_msi_ops x86_msi = { 112struct x86_msi_ops x86_msi = {
111 .setup_msi_irqs = native_setup_msi_irqs, 113 .setup_msi_irqs = native_setup_msi_irqs,
112 .compose_msi_msg = native_compose_msi_msg, 114 .compose_msi_msg = native_compose_msi_msg,
@@ -116,6 +118,28 @@ struct x86_msi_ops x86_msi = {
116 .setup_hpet_msi = default_setup_hpet_msi, 118 .setup_hpet_msi = default_setup_hpet_msi,
117}; 119};
118 120
121/* MSI arch specific hooks */
122int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
123{
124 return x86_msi.setup_msi_irqs(dev, nvec, type);
125}
126
127void arch_teardown_msi_irqs(struct pci_dev *dev)
128{
129 x86_msi.teardown_msi_irqs(dev);
130}
131
132void arch_teardown_msi_irq(unsigned int irq)
133{
134 x86_msi.teardown_msi_irq(irq);
135}
136
137void arch_restore_msi_irqs(struct pci_dev *dev, int irq)
138{
139 x86_msi.restore_msi_irqs(dev, irq);
140}
141#endif
142
119struct x86_io_apic_ops x86_io_apic_ops = { 143struct x86_io_apic_ops x86_io_apic_ops = {
120 .init = native_io_apic_init_mappings, 144 .init = native_io_apic_init_mappings,
121 .read = native_io_apic_read, 145 .read = native_io_apic_read,