Skip to contentSkip to conversation

linux-2.6.5-rc2_cpukhz-fix_A1

PATCH New john stultz 1 participant 1 message Mar 24, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.5-rc2_cpukhz-fix_A1

Andrew, All,
This small patch insures that cpu_khz is adjusted on cpufreq
notifications even when the tsc timesource is not in use. It fixes the mostly cosmetic issue when using the ACPI PM timesource of /proc/cpuinfo not being properly updated when cpu frequency was lowered.

Changelog:
A0: Original release
A1: Whitespace fix suggested by [email protected]

Andrew: Please consider for inclusion into your tree for further testing.

thanks
-john

arch/i386/kernel/timers/timer_tsc.c +2 -1
diff -Nru a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c
@@ -360,8 +360,9 @@
 		if (variable_tsc)
 			cpu_data[freq->cpu].loops_per_jiffy = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new);
 #ifndef CONFIG_SMP
-		if (use_tsc) {
+		if (cpu_khz)
 			cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new);
+		if (use_tsc) {
 			if (variable_tsc) {
 				fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq);
 				set_cyc2ns_scale(cpu_khz/1000);