Commit 7177784e authored by Zwane Mwaikambo's avatar Zwane Mwaikambo Committed by Linus Torvalds

[PATCH] fix i386/x86_64 idle routine selection

This was broken when the mwait stuff went in since it executes after the
initial idle_setup() has already selected an idle routine and overrides it
with default_idle.
Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Signed-off-by: default avatarZwane Mwaikambo <zwane@linuxpower.ca>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent fefd81e1
...@@ -183,18 +183,13 @@ void __init select_idle_routine(const struct cpuinfo_x86 *c) ...@@ -183,18 +183,13 @@ void __init select_idle_routine(const struct cpuinfo_x86 *c)
printk("monitor/mwait feature present.\n"); printk("monitor/mwait feature present.\n");
/* /*
* Skip, if setup has overridden idle. * Skip, if setup has overridden idle.
* Also, take care of system with asymmetric CPUs. * One CPU supports mwait => All CPUs supports mwait
* Use, mwait_idle only if all cpus support it.
* If not, we fallback to default_idle()
*/ */
if (!pm_idle) { if (!pm_idle) {
printk("using mwait in idle threads.\n"); printk("using mwait in idle threads.\n");
pm_idle = mwait_idle; pm_idle = mwait_idle;
} }
return;
} }
pm_idle = default_idle;
return;
} }
static int __init idle_setup (char *str) static int __init idle_setup (char *str)
......
...@@ -168,9 +168,7 @@ void __init select_idle_routine(const struct cpuinfo_x86 *c) ...@@ -168,9 +168,7 @@ void __init select_idle_routine(const struct cpuinfo_x86 *c)
if (cpu_has(c, X86_FEATURE_MWAIT)) { if (cpu_has(c, X86_FEATURE_MWAIT)) {
/* /*
* Skip, if setup has overridden idle. * Skip, if setup has overridden idle.
* Also, take care of system with asymmetric CPUs. * One CPU supports mwait => All CPUs supports mwait
* Use, mwait_idle only if all cpus support it.
* If not, we fallback to default_idle()
*/ */
if (!pm_idle) { if (!pm_idle) {
if (!printed) { if (!printed) {
...@@ -179,10 +177,7 @@ void __init select_idle_routine(const struct cpuinfo_x86 *c) ...@@ -179,10 +177,7 @@ void __init select_idle_routine(const struct cpuinfo_x86 *c)
} }
pm_idle = mwait_idle; pm_idle = mwait_idle;
} }
return;
} }
pm_idle = default_idle;
return;
} }
static int __init idle_setup (char *str) static int __init idle_setup (char *str)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment