From e9c7ac4a72c007571ef423f3b047624350182d88 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 26 Mar 2004 21:01:55 -0800 Subject: [PATCH] [PATCH] adjuct cpu_khz in response to cpufreq changes From: john stultz This patch ensures 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. --- arch/i386/kernel/timers/timer_tsc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/i386/kernel/timers/timer_tsc.c b/arch/i386/kernel/timers/timer_tsc.c index 39fe12730d02f..370c568067ff6 100644 --- a/arch/i386/kernel/timers/timer_tsc.c +++ b/arch/i386/kernel/timers/timer_tsc.c @@ -360,8 +360,9 @@ time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, 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); -- 2.53.0