提交 bcf0f0d2 编写于 作者: L Larry Finger 提交者: Linus Torvalds

[PATCH] fix cpu frequency detection in arch/i386/kernel/timers/timer_tsc.c::recalibrate_cpu_khz()

When we re-calibrate the frequency, it is likely that an interrupt (as for
example the main system clock) will be triggered by the system.  Therefore
the calibration may not be accurate.  This will also provide a fix to bug
#5266.

Many thanks to Larry Finger for helping resolving this issue.
Signed-off-by: NBruno Ducrot <ducrot@poupinou.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 3841b0a1
...@@ -330,7 +330,9 @@ int recalibrate_cpu_khz(void) ...@@ -330,7 +330,9 @@ int recalibrate_cpu_khz(void)
unsigned int cpu_khz_old = cpu_khz; unsigned int cpu_khz_old = cpu_khz;
if (cpu_has_tsc) { if (cpu_has_tsc) {
local_irq_disable();
init_cpu_khz(); init_cpu_khz();
local_irq_enable();
cpu_data[0].loops_per_jiffy = cpu_data[0].loops_per_jiffy =
cpufreq_scale(cpu_data[0].loops_per_jiffy, cpufreq_scale(cpu_data[0].loops_per_jiffy,
cpu_khz_old, cpu_khz_old,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册