diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-28 11:26:12 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-28 11:26:12 -0400 |
commit | 7a9787e1eba95a166265e6a260cf30af04ef0a99 (patch) | |
tree | e730a4565e0318140d2fbd2f0415d18a339d7336 /arch/x86/kernel/process.c | |
parent | 41b9eb264c8407655db57b60b4457fe1b2ec9977 (diff) | |
parent | 0173a3265b228da319ceb9c1ec6a5682fd1b2d92 (diff) |
Merge commit 'v2.6.28-rc2' into x86/pci-ioapic-boot-irq-quirks
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 4d629c62f4f8..c622772744d8 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -184,7 +184,8 @@ static void mwait_idle(void) | |||
184 | static void poll_idle(void) | 184 | static void poll_idle(void) |
185 | { | 185 | { |
186 | local_irq_enable(); | 186 | local_irq_enable(); |
187 | cpu_relax(); | 187 | while (!need_resched()) |
188 | cpu_relax(); | ||
188 | } | 189 | } |
189 | 190 | ||
190 | /* | 191 | /* |
@@ -199,6 +200,7 @@ static void poll_idle(void) | |||
199 | * | 200 | * |
200 | * idle=mwait overrides this decision and forces the usage of mwait. | 201 | * idle=mwait overrides this decision and forces the usage of mwait. |
201 | */ | 202 | */ |
203 | static int __cpuinitdata force_mwait; | ||
202 | 204 | ||
203 | #define MWAIT_INFO 0x05 | 205 | #define MWAIT_INFO 0x05 |
204 | #define MWAIT_ECX_EXTENDED_INFO 0x01 | 206 | #define MWAIT_ECX_EXTENDED_INFO 0x01 |
@@ -244,6 +246,14 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) | |||
244 | return 1; | 246 | return 1; |
245 | } | 247 | } |
246 | 248 | ||
249 | static cpumask_t c1e_mask = CPU_MASK_NONE; | ||
250 | static int c1e_detected; | ||
251 | |||
252 | void c1e_remove_cpu(int cpu) | ||
253 | { | ||
254 | cpu_clear(cpu, c1e_mask); | ||
255 | } | ||
256 | |||
247 | /* | 257 | /* |
248 | * C1E aware idle routine. We check for C1E active in the interrupt | 258 | * C1E aware idle routine. We check for C1E active in the interrupt |
249 | * pending message MSR. If we detect C1E, then we handle it the same | 259 | * pending message MSR. If we detect C1E, then we handle it the same |
@@ -251,9 +261,6 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) | |||
251 | */ | 261 | */ |
252 | static void c1e_idle(void) | 262 | static void c1e_idle(void) |
253 | { | 263 | { |
254 | static cpumask_t c1e_mask = CPU_MASK_NONE; | ||
255 | static int c1e_detected; | ||
256 | |||
257 | if (need_resched()) | 264 | if (need_resched()) |
258 | return; | 265 | return; |
259 | 266 | ||
@@ -263,8 +270,10 @@ static void c1e_idle(void) | |||
263 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); | 270 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); |
264 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { | 271 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { |
265 | c1e_detected = 1; | 272 | c1e_detected = 1; |
266 | mark_tsc_unstable("TSC halt in C1E"); | 273 | if (!boot_cpu_has(X86_FEATURE_CONSTANT_TSC)) |
267 | printk(KERN_INFO "System has C1E enabled\n"); | 274 | mark_tsc_unstable("TSC halt in AMD C1E"); |
275 | printk(KERN_INFO "System has AMD C1E enabled\n"); | ||
276 | set_cpu_cap(&boot_cpu_data, X86_FEATURE_AMDC1E); | ||
268 | } | 277 | } |
269 | } | 278 | } |
270 | 279 | ||
@@ -326,6 +335,9 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) | |||
326 | 335 | ||
327 | static int __init idle_setup(char *str) | 336 | static int __init idle_setup(char *str) |
328 | { | 337 | { |
338 | if (!str) | ||
339 | return -EINVAL; | ||
340 | |||
329 | if (!strcmp(str, "poll")) { | 341 | if (!strcmp(str, "poll")) { |
330 | printk("using polling idle threads.\n"); | 342 | printk("using polling idle threads.\n"); |
331 | pm_idle = poll_idle; | 343 | pm_idle = poll_idle; |