aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/tsc.c40
1 files changed, 2 insertions, 38 deletions
diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c
index 46f752a8bbf3..d4000649942a 100644
--- a/arch/i386/kernel/tsc.c
+++ b/arch/i386/kernel/tsc.c
@@ -222,34 +222,6 @@ out_no_tsc:
222 222
223#ifdef CONFIG_CPU_FREQ 223#ifdef CONFIG_CPU_FREQ
224 224
225static unsigned int cpufreq_delayed_issched = 0;
226static unsigned int cpufreq_init = 0;
227static struct work_struct cpufreq_delayed_get_work;
228
229static void handle_cpufreq_delayed_get(struct work_struct *work)
230{
231 unsigned int cpu;
232
233 for_each_online_cpu(cpu)
234 cpufreq_get(cpu);
235
236 cpufreq_delayed_issched = 0;
237}
238
239/*
240 * if we notice cpufreq oddness, schedule a call to cpufreq_get() as it tries
241 * to verify the CPU frequency the timing core thinks the CPU is running
242 * at is still correct.
243 */
244static inline void cpufreq_delayed_get(void)
245{
246 if (cpufreq_init && !cpufreq_delayed_issched) {
247 cpufreq_delayed_issched = 1;
248 printk(KERN_DEBUG "Checking if CPU frequency changed.\n");
249 schedule_work(&cpufreq_delayed_get_work);
250 }
251}
252
253/* 225/*
254 * if the CPU frequency is scaled, TSC-based delays will need a different 226 * if the CPU frequency is scaled, TSC-based delays will need a different
255 * loops_per_jiffy value to function properly. 227 * loops_per_jiffy value to function properly.
@@ -313,17 +285,9 @@ static struct notifier_block time_cpufreq_notifier_block = {
313 285
314static int __init cpufreq_tsc(void) 286static int __init cpufreq_tsc(void)
315{ 287{
316 int ret; 288 return cpufreq_register_notifier(&time_cpufreq_notifier_block,
317 289 CPUFREQ_TRANSITION_NOTIFIER);
318 INIT_WORK(&cpufreq_delayed_get_work, handle_cpufreq_delayed_get);
319 ret = cpufreq_register_notifier(&time_cpufreq_notifier_block,
320 CPUFREQ_TRANSITION_NOTIFIER);
321 if (!ret)
322 cpufreq_init = 1;
323
324 return ret;
325} 290}
326
327core_initcall(cpufreq_tsc); 291core_initcall(cpufreq_tsc);
328 292
329#endif 293#endif