[PATCH] x86: move enabling of io_apic to prepare_cpus

From: Glauber Costa
Date: Wed May 28 2008 - 16:04:12 EST


Do it, instead of keeping in io_apic_32.c. This is the way x86_64 already does.

Signed-off-by: Glauber Costa <gcosta@xxxxxxxxxx>
---
arch/x86/kernel/apic_32.c | 3 +++
arch/x86/kernel/io_apic_32.c | 4 ++--
arch/x86/kernel/smpboot.c | 2 +-
include/asm-x86/hw_irq.h | 2 --
4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
index fa8cf79..8385dc6 100644
--- a/arch/x86/kernel/apic_32.c
+++ b/arch/x86/kernel/apic_32.c
@@ -1273,6 +1273,9 @@ int __init APIC_init_uniprocessor(void)
setup_local_APIC();

#ifdef CONFIG_X86_IO_APIC
+ if (!skip_ioapic_setup && nr_ioapics)
+ enable_IO_APIC();
+
if (!smp_found_config || skip_ioapic_setup || !nr_ioapics)
#endif
localise_nmi_watchdog();
diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 7fc071f..fa4f0a0 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -1606,7 +1606,7 @@ void /*__init*/ print_PIC(void)

#endif /* 0 */

-static void __init enable_IO_APIC(void)
+void __init enable_IO_APIC(void)
{
union IO_APIC_reg_01 reg_01;
int i8259_apic, i8259_pin;
@@ -2295,7 +2295,7 @@ void __init setup_IO_APIC(void)
for (i = first_system_vector; i < NR_VECTORS; i++)
set_bit(i, used_vectors);

- enable_IO_APIC();
+ /* calling enable_IO_APIC() is moved to setup_local_APIC for BP */

if (acpi_ioapic)
io_apic_irqs = ~0; /* all IRQs go through IOAPIC */
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index f5ac5b2..e537c7b 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1175,7 +1175,7 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus)
*/
setup_local_APIC();

-#ifdef CONFIG_X86_64
+#ifdef CONFIG_X86_IO_APIC
/*
* Enable IO APIC before setting up error vector
*/
diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h
index 18f067c..4c81d1b 100644
--- a/include/asm-x86/hw_irq.h
+++ b/include/asm-x86/hw_irq.h
@@ -67,9 +67,7 @@ extern void print_IO_APIC(void);
extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn);
extern void setup_ioapic_dest(void);

-#ifdef CONFIG_X86_64
extern void enable_IO_APIC(void);
-#endif

/* IPI functions */
extern void send_IPI_self(int vector);
--
1.5.4.5


--------------060401050605090806010400--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/