Skip to content

Commit 63b5d7a

Browse files
yhluIngo Molnar
authored andcommitted
x86: add ->pre_time_init to x86_quirks
so NUMAQ can use that to call numaq_pre_time_init() This allows us to remove a NUMAQ special from arch/x86/kernel/setup.c. (and paves the way to remove the NUMAQ subarch) Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 64898a8 commit 63b5d7a

File tree

6 files changed

+20
-8
lines changed

6 files changed

+20
-8
lines changed

arch/x86/kernel/numaq_32.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ void __init numaq_tsc_disable(void)
8484
}
8585
}
8686

87+
static int __init numaq_pre_time_init(void)
88+
{
89+
numaq_tsc_disable();
90+
return 0;
91+
}
92+
8793
int found_numaq;
8894
/*
8995
* Have to match translation table entries to main table entries by counter
@@ -224,6 +230,7 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable,
224230
}
225231

226232
static struct x86_quirks numaq_x86_quirks __initdata = {
233+
.arch_pre_time_init = numaq_pre_time_init,
227234
.arch_time_init = NULL,
228235
.arch_pre_intr_init = NULL,
229236
.arch_memory_setup = NULL,

arch/x86/kernel/setup.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -853,14 +853,6 @@ void __init setup_arch(char **cmdline_p)
853853
init_cpu_to_node();
854854
#endif
855855

856-
#ifdef CONFIG_X86_NUMAQ
857-
/*
858-
* need to check online nodes num, call it
859-
* here before time_init/tsc_init
860-
*/
861-
numaq_tsc_disable();
862-
#endif
863-
864856
init_apic_mappings();
865857
ioapic_init_mappings();
866858

arch/x86/kernel/time_32.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ void __init hpet_time_init(void)
129129
*/
130130
void __init time_init(void)
131131
{
132+
pre_time_init_hook();
132133
tsc_init();
133134
late_time_init = choose_time_init();
134135
}

arch/x86/mach-default/setup.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,16 @@ static struct irqaction irq0 = {
102102
.name = "timer"
103103
};
104104

105+
/**
106+
* pre_time_init_hook - do any specific initialisations before.
107+
*
108+
**/
109+
void __init pre_time_init_hook(void)
110+
{
111+
if (x86_quirks->arch_pre_time_init)
112+
x86_quirks->arch_pre_time_init();
113+
}
114+
105115
/**
106116
* time_init_hook - do any specific initialisations for the system timer.
107117
*

include/asm-x86/arch_hooks.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extern void intr_init_hook(void);
2121
extern void pre_intr_init_hook(void);
2222
extern void pre_setup_arch_hook(void);
2323
extern void trap_init_hook(void);
24+
extern void pre_time_init_hook(void);
2425
extern void time_init_hook(void);
2526
extern void mca_nmi_hook(void);
2627

include/asm-x86/setup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ struct mpc_config_processor;
2323
struct mpc_config_bus;
2424
struct mp_config_oemtable;
2525
struct x86_quirks {
26+
int (*arch_pre_time_init)(void);
2627
int (*arch_time_init)(void);
2728
int (*arch_pre_intr_init)(void);
2829
int (*arch_intr_init)(void);

0 commit comments

Comments
 (0)