Skip to contentSkip to conversation

P4 clock mod: recalibrate_cpu_khz on ia32 only

PATCH In review Frederik Deweerdt 2 participants 2 messages Mar 30, 2009 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 P4 clock mod: recalibrate_cpu_khz on ia32 only

Hello Dave,

I just triggered the following compile error with an old .config on x86_64, (latest git):

CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86

  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CC [M]  arch/x86/kernel/cpu/cpufreq/p4-clockmod.o

arch/x86/kernel/cpu/cpufreq/p4-clockmod.c: In function ‘cpufreq_p4_cpu_init’:
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c:232: error: implicit declaration of function ‘recalibrate_cpu_khz’ make[3]: *** [arch/x86/kernel/cpu/cpufreq/p4-clockmod.o] Error 1
make[2]: *** [arch/x86/kernel/cpu/cpufreq] Error 2
make[1]: *** [arch/x86/kernel/cpu] Error 2
make: *** [arch/x86/kernel] Error 2

The attached patch calls recalibrate_cpu_khz on ia32 only

Regards,
Frederik

arch/x86/kernel/cpu/cpufreq/p4-clockmod.c +2 -0
index 41ed949..88be236 100644
@@ -229,7 +229,9 @@ static int cpufreq_p4_cpu_init(struct cpufreq_policy *policy)
 	    c->x86_model < 2) {
 		/* switch to maximum frequency and measure result */
 		cpufreq_p4_setdc(policy->cpu, DC_DISABLE);
+#ifdef CONFIG_X86_32
 		recalibrate_cpu_khz();
+#endif
 	}
 	/* get max frequency */
 	stock_freq = cpufreq_p4_get_frequency(c);
#1 lore raw
Quoted 11 lines · Frederik Deweerdt

Hello Dave,

I just triggered the following compile error with an old .config on x86_64, (latest git):

CHK include/linux/version.h
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-x86

  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CC [M]  arch/x86/kernel/cpu/cpufreq/p4-clockmod.o
Quoted 8 lines

arch/x86/kernel/cpu/cpufreq/p4-clockmod.c: In function ‘cpufreq_p4_cpu_init’:
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c:232: error: implicit declaration of function ‘recalibrate_cpu_khz’ make[3]: *** [arch/x86/kernel/cpu/cpufreq/p4-clockmod.o] Error 1
make[2]: *** [arch/x86/kernel/cpu/cpufreq] Error 2
make[1]: *** [arch/x86/kernel/cpu] Error 2
make: *** [arch/x86/kernel] Error 2

The attached patch calls recalibrate_cpu_khz on ia32 only

Wrong fix. It needs to be called on 64 bit too.
The real fix is to reinstate this diff which the recent x86 merge reverted..

arch/x86/include/asm/timer.h +1 -1
index 2bb6a83..4f5c247 100644
@@ -11,8 +11,8 @@ unsigned long native_calibrate_tsc(void);
 
 #ifdef CONFIG_X86_32
 extern int timer_ack;
+#endif
 extern int recalibrate_cpu_khz(void);
-#endif /* CONFIG_X86_32 */
 
 extern int no_timer_check;