diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-29 14:18:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-29 14:18:09 -0400 |
commit | f310642123e0d32d919c60ca3fab5acd130c4ba3 (patch) | |
tree | f3844152e2e8c0fdd01621a400f84c8a159252a0 /arch/x86/kernel/process.c | |
parent | ef1d57599dc904fdb31b8e9b5336350d21a1fde1 (diff) | |
parent | 5d4c47e0195b989f284907358bd5c268a44b91c7 (diff) |
Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6
* 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
x86 idle: deprecate mwait_idle() and "idle=mwait" cmdline param
x86 idle: deprecate "no-hlt" cmdline param
x86 idle APM: deprecate CONFIG_APM_CPU_IDLE
x86 idle floppy: deprecate disable_hlt()
x86 idle: EXPORT_SYMBOL(default_idle, pm_idle) only when APM demands it
x86 idle: clarify AMD erratum 400 workaround
idle governor: Avoid lock acquisition to read pm_qos before entering idle
cpuidle: menu: fixed wrapping timers at 4.294 seconds
Diffstat (limited to 'arch/x86/kernel/process.c')
-rw-r--r-- | arch/x86/kernel/process.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 88a90a977f8e..426a5b66f7e4 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -337,7 +337,9 @@ EXPORT_SYMBOL(boot_option_idle_override); | |||
337 | * Powermanagement idle function, if any.. | 337 | * Powermanagement idle function, if any.. |
338 | */ | 338 | */ |
339 | void (*pm_idle)(void); | 339 | void (*pm_idle)(void); |
340 | #if defined(CONFIG_APM_MODULE) && defined(CONFIG_APM_CPU_IDLE) | ||
340 | EXPORT_SYMBOL(pm_idle); | 341 | EXPORT_SYMBOL(pm_idle); |
342 | #endif | ||
341 | 343 | ||
342 | #ifdef CONFIG_X86_32 | 344 | #ifdef CONFIG_X86_32 |
343 | /* | 345 | /* |
@@ -397,7 +399,7 @@ void default_idle(void) | |||
397 | cpu_relax(); | 399 | cpu_relax(); |
398 | } | 400 | } |
399 | } | 401 | } |
400 | #ifdef CONFIG_APM_MODULE | 402 | #if defined(CONFIG_APM_MODULE) && defined(CONFIG_APM_CPU_IDLE) |
401 | EXPORT_SYMBOL(default_idle); | 403 | EXPORT_SYMBOL(default_idle); |
402 | #endif | 404 | #endif |
403 | 405 | ||
@@ -535,45 +537,45 @@ int mwait_usable(const struct cpuinfo_x86 *c) | |||
535 | return (edx & MWAIT_EDX_C1); | 537 | return (edx & MWAIT_EDX_C1); |
536 | } | 538 | } |
537 | 539 | ||
538 | bool c1e_detected; | 540 | bool amd_e400_c1e_detected; |
539 | EXPORT_SYMBOL(c1e_detected); | 541 | EXPORT_SYMBOL(amd_e400_c1e_detected); |
540 | 542 | ||
541 | static cpumask_var_t c1e_mask; | 543 | static cpumask_var_t amd_e400_c1e_mask; |
542 | 544 | ||
543 | void c1e_remove_cpu(int cpu) | 545 | void amd_e400_remove_cpu(int cpu) |
544 | { | 546 | { |
545 | if (c1e_mask != NULL) | 547 | if (amd_e400_c1e_mask != NULL) |
546 | cpumask_clear_cpu(cpu, c1e_mask); | 548 | cpumask_clear_cpu(cpu, amd_e400_c1e_mask); |
547 | } | 549 | } |
548 | 550 | ||
549 | /* | 551 | /* |
550 | * C1E aware idle routine. We check for C1E active in the interrupt | 552 | * AMD Erratum 400 aware idle routine. We check for C1E active in the interrupt |
551 | * pending message MSR. If we detect C1E, then we handle it the same | 553 | * pending message MSR. If we detect C1E, then we handle it the same |
552 | * way as C3 power states (local apic timer and TSC stop) | 554 | * way as C3 power states (local apic timer and TSC stop) |
553 | */ | 555 | */ |
554 | static void c1e_idle(void) | 556 | static void amd_e400_idle(void) |
555 | { | 557 | { |
556 | if (need_resched()) | 558 | if (need_resched()) |
557 | return; | 559 | return; |
558 | 560 | ||
559 | if (!c1e_detected) { | 561 | if (!amd_e400_c1e_detected) { |
560 | u32 lo, hi; | 562 | u32 lo, hi; |
561 | 563 | ||
562 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); | 564 | rdmsr(MSR_K8_INT_PENDING_MSG, lo, hi); |
563 | 565 | ||
564 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { | 566 | if (lo & K8_INTP_C1E_ACTIVE_MASK) { |
565 | c1e_detected = true; | 567 | amd_e400_c1e_detected = true; |
566 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) | 568 | if (!boot_cpu_has(X86_FEATURE_NONSTOP_TSC)) |
567 | mark_tsc_unstable("TSC halt in AMD C1E"); | 569 | mark_tsc_unstable("TSC halt in AMD C1E"); |
568 | printk(KERN_INFO "System has AMD C1E enabled\n"); | 570 | printk(KERN_INFO "System has AMD C1E enabled\n"); |
569 | } | 571 | } |
570 | } | 572 | } |
571 | 573 | ||
572 | if (c1e_detected) { | 574 | if (amd_e400_c1e_detected) { |
573 | int cpu = smp_processor_id(); | 575 | int cpu = smp_processor_id(); |
574 | 576 | ||
575 | if (!cpumask_test_cpu(cpu, c1e_mask)) { | 577 | if (!cpumask_test_cpu(cpu, amd_e400_c1e_mask)) { |
576 | cpumask_set_cpu(cpu, c1e_mask); | 578 | cpumask_set_cpu(cpu, amd_e400_c1e_mask); |
577 | /* | 579 | /* |
578 | * Force broadcast so ACPI can not interfere. | 580 | * Force broadcast so ACPI can not interfere. |
579 | */ | 581 | */ |
@@ -616,17 +618,17 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c) | |||
616 | pm_idle = mwait_idle; | 618 | pm_idle = mwait_idle; |
617 | } else if (cpu_has_amd_erratum(amd_erratum_400)) { | 619 | } else if (cpu_has_amd_erratum(amd_erratum_400)) { |
618 | /* E400: APIC timer interrupt does not wake up CPU from C1e */ | 620 | /* E400: APIC timer interrupt does not wake up CPU from C1e */ |
619 | printk(KERN_INFO "using C1E aware idle routine\n"); | 621 | printk(KERN_INFO "using AMD E400 aware idle routine\n"); |
620 | pm_idle = c1e_idle; | 622 | pm_idle = amd_e400_idle; |
621 | } else | 623 | } else |
622 | pm_idle = default_idle; | 624 | pm_idle = default_idle; |
623 | } | 625 | } |
624 | 626 | ||
625 | void __init init_c1e_mask(void) | 627 | void __init init_amd_e400_c1e_mask(void) |
626 | { | 628 | { |
627 | /* If we're using c1e_idle, we need to allocate c1e_mask. */ | 629 | /* If we're using amd_e400_idle, we need to allocate amd_e400_c1e_mask. */ |
628 | if (pm_idle == c1e_idle) | 630 | if (pm_idle == amd_e400_idle) |
629 | zalloc_cpumask_var(&c1e_mask, GFP_KERNEL); | 631 | zalloc_cpumask_var(&amd_e400_c1e_mask, GFP_KERNEL); |
630 | } | 632 | } |
631 | 633 | ||
632 | static int __init idle_setup(char *str) | 634 | static int __init idle_setup(char *str) |
@@ -640,6 +642,7 @@ static int __init idle_setup(char *str) | |||
640 | boot_option_idle_override = IDLE_POLL; | 642 | boot_option_idle_override = IDLE_POLL; |
641 | } else if (!strcmp(str, "mwait")) { | 643 | } else if (!strcmp(str, "mwait")) { |
642 | boot_option_idle_override = IDLE_FORCE_MWAIT; | 644 | boot_option_idle_override = IDLE_FORCE_MWAIT; |
645 | WARN_ONCE(1, "\idle=mwait\" will be removed in 2012\"\n"); | ||
643 | } else if (!strcmp(str, "halt")) { | 646 | } else if (!strcmp(str, "halt")) { |
644 | /* | 647 | /* |
645 | * When the boot option of idle=halt is added, halt is | 648 | * When the boot option of idle=halt is added, halt is |