Commit 0c759131 authored by Dou Liyang's avatar Dou Liyang Committed by Thomas Gleixner

x86/apic: Unify interrupt mode setup for UP system

In UniProcessor kernel with UP_LATE_INIT=y, the interrupt delivery mode is
initialized in up_late_init().

Use the new unified apic_intr_mode_init() function and remove
APIC_init_uniprocessor().
Signed-off-by: default avatarDou Liyang <douly.fnst@cn.fujitsu.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: yinghai@kernel.org
Cc: bhe@redhat.com
Link: https://lkml.kernel.org/r/1505293975-26005-8-git-send-email-douly.fnst@cn.fujitsu.com
parent 4f45ed9f
...@@ -144,7 +144,6 @@ void register_lapic_address(unsigned long address); ...@@ -144,7 +144,6 @@ void register_lapic_address(unsigned long address);
extern void setup_boot_APIC_clock(void); extern void setup_boot_APIC_clock(void);
extern void setup_secondary_APIC_clock(void); extern void setup_secondary_APIC_clock(void);
extern void lapic_update_tsc_freq(void); extern void lapic_update_tsc_freq(void);
extern int APIC_init_uniprocessor(void);
#ifdef CONFIG_X86_64 #ifdef CONFIG_X86_64
static inline int apic_force_enable(unsigned long addr) static inline int apic_force_enable(unsigned long addr)
......
...@@ -1334,7 +1334,7 @@ void __init init_bsp_APIC(void) ...@@ -1334,7 +1334,7 @@ void __init init_bsp_APIC(void)
/* Init the interrupt delivery mode for the BSP */ /* Init the interrupt delivery mode for the BSP */
void __init apic_intr_mode_init(void) void __init apic_intr_mode_init(void)
{ {
bool upmode = false; bool upmode = IS_ENABLED(CONFIG_UP_LATE_INIT);
apic_intr_mode = apic_intr_mode_select(); apic_intr_mode = apic_intr_mode_select();
...@@ -2420,51 +2420,16 @@ void __init apic_bsp_setup(bool upmode) ...@@ -2420,51 +2420,16 @@ void __init apic_bsp_setup(bool upmode)
setup_IO_APIC(); setup_IO_APIC();
} }
/* #ifdef CONFIG_UP_LATE_INIT
* This initializes the IO-APIC and APIC hardware if this is void __init up_late_init(void)
* a UP kernel.
*/
int __init APIC_init_uniprocessor(void)
{ {
if (disable_apic) { apic_intr_mode_init();
pr_info("Apic disabled\n");
return -1;
}
#ifdef CONFIG_X86_64
if (!boot_cpu_has(X86_FEATURE_APIC)) {
disable_apic = 1;
pr_info("Apic disabled by BIOS\n");
return -1;
}
#else
if (!smp_found_config && !boot_cpu_has(X86_FEATURE_APIC))
return -1;
/*
* Complain if the BIOS pretends there is one.
*/
if (!boot_cpu_has(X86_FEATURE_APIC) &&
APIC_INTEGRATED(boot_cpu_apic_version)) {
pr_err("BIOS bug, local APIC 0x%x not detected!...\n",
boot_cpu_physical_apicid);
return -1;
}
#endif
if (!smp_found_config) if (apic_intr_mode == APIC_PIC)
disable_ioapic_support(); return;
default_setup_apic_routing();
apic_bsp_setup(true);
/* Setup local timer */ /* Setup local timer */
x86_init.timers.setup_percpu_clockev(); x86_init.timers.setup_percpu_clockev();
return 0;
}
#ifdef CONFIG_UP_LATE_INIT
void __init up_late_init(void)
{
APIC_init_uniprocessor();
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment