|
@@ -479,7 +479,8 @@ static int c1e_detected;
|
|
|
|
|
|
void c1e_remove_cpu(int cpu)
|
|
|
{
|
|
|
- cpumask_clear_cpu(cpu, c1e_mask);
|
|
|
+ if (c1e_mask != NULL)
|
|
|
+ cpumask_clear_cpu(cpu, c1e_mask);
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -556,13 +557,20 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
|
|
|
pm_idle = mwait_idle;
|
|
|
} else if (check_c1e_idle(c)) {
|
|
|
printk(KERN_INFO "using C1E aware idle routine\n");
|
|
|
- alloc_cpumask_var(&c1e_mask, GFP_KERNEL);
|
|
|
- cpumask_clear(c1e_mask);
|
|
|
pm_idle = c1e_idle;
|
|
|
} else
|
|
|
pm_idle = default_idle;
|
|
|
}
|
|
|
|
|
|
+void __init init_c1e_mask(void)
|
|
|
+{
|
|
|
+ /* If we're using c1e_idle, we need to allocate c1e_mask. */
|
|
|
+ if (pm_idle == c1e_idle) {
|
|
|
+ alloc_cpumask_var(&c1e_mask, GFP_KERNEL);
|
|
|
+ cpumask_clear(c1e_mask);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static int __init idle_setup(char *str)
|
|
|
{
|
|
|
if (!str)
|