x86/apic: Split out restore_boot_irq_mode() from disable_IO_APIC()
authorBaoquan He <[email protected]>
Wed, 14 Feb 2018 05:46:51 +0000 (13:46 +0800)
committerIngo Molnar <[email protected]>
Sat, 17 Feb 2018 10:47:29 +0000 (11:47 +0100)
This is a preparation patch. Split out the code which restores boot
irq mode from disable_IO_APIC() into the new restore_boot_irq_mode()
function.

No functional changes.

Signed-off-by: Baoquan He <[email protected]>
Reviewed-by: Eric W. Biederman <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: http://lkml.kernel.org/r/[email protected]
[ Build fix for !CONFIG_IO_APIC and rewrote the changelog. ]
Signed-off-by: Ingo Molnar <[email protected]>
arch/x86/include/asm/io_apic.h
arch/x86/kernel/apic/io_apic.c

index a8834dd546cdb10ce148262a55cf18653876d7c7..4e3bb13e02a6c2311ecb830c54d8aa685d6f36ad 100644 (file)
@@ -193,6 +193,7 @@ static inline unsigned int io_apic_read(unsigned int apic, unsigned int reg)
 extern void setup_IO_APIC(void);
 extern void enable_IO_APIC(void);
 extern void disable_IO_APIC(void);
+extern void restore_boot_irq_mode(void);
 extern int IO_APIC_get_PCI_irq_vector(int bus, int devfn, int pin);
 extern void print_IO_APICs(void);
 #else  /* !CONFIG_X86_IO_APIC */
@@ -232,6 +233,7 @@ static inline void io_apic_init_mappings(void) { }
 
 static inline void setup_IO_APIC(void) { }
 static inline void enable_IO_APIC(void) { }
+static inline void restore_boot_irq_mode(void) { }
 
 #endif
 
index 8ad2e410974f2d4b71a44f033e8c046671b89622..7b73b6b9b4b6842be361ef8dbf63f216e2be4f22 100644 (file)
@@ -1448,6 +1448,11 @@ void disable_IO_APIC(void)
         */
        clear_IO_APIC();
 
+       restore_boot_irq_mode();
+}
+
+void restore_boot_irq_mode(void)
+{
        if (!nr_legacy_irqs())
                return;