Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 Feb 2013 21:34:11 +0000 (22:34 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 18 Feb 2013 21:34:11 +0000 (22:34 +0100)
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (35 commits)
  PM idle: remove global declaration of pm_idle
  unicore32 idle: delete stray pm_idle comment
  openrisc idle: delete pm_idle
  mn10300 idle: delete pm_idle
  microblaze idle: delete pm_idle
  m32r idle: delete pm_idle, and other dead idle code
  ia64 idle: delete pm_idle
  cris idle: delete idle and pm_idle
  ARM64 idle: delete pm_idle
  ARM idle: delete pm_idle
  blackfin idle: delete pm_idle
  sparc idle: rename pm_idle to sparc_idle
  sh idle: rename global pm_idle to static sh_idle
  x86 idle: rename global pm_idle to static x86_idle
  APM idle: register apm_cpu_idle via cpuidle
  tools/power turbostat: display SMI count by default
  intel_idle: export both C1 and C1E
  cpuidle: remove vestage definition of cpuidle_state_usage.driver_data
  x86 idle: remove 32-bit-only "no-hlt" parameter, hlt_works_ok flag
  x86 idle: remove mwait_idle() and "idle=mwait" cmdline param
  ...

Conflicts:
arch/x86/kernel/process.c (with PM / tracing commit 43720bd)
drivers/acpi/processor_idle.c (with ACPICA commit 4f84291)

1  2 
Documentation/kernel-parameters.txt
arch/x86/Kconfig
arch/x86/kernel/process.c

@@@ -1039,16 -1039,11 +1039,11 @@@ bytes respectively. Such letter suffixe
                        Claim all unknown PCI IDE storage controllers.
  
        idle=           [X86]
-                       Format: idle=poll, idle=mwait, idle=halt, idle=nomwait
+                       Format: idle=poll, idle=halt, idle=nomwait
                        Poll forces a polling idle loop that can slightly
                        improve the performance of waking up a idle CPU, but
                        will use a lot of power and make the system run hot.
                        Not recommended.
-                       idle=mwait: On systems which support MONITOR/MWAIT but
-                       the kernel chose to not use it because it doesn't save
-                       as much power as a normal idle loop, use the
-                       MONITOR/MWAIT idle loop anyways. Performance should be
-                       the same as idle=poll.
                        idle=halt: Halt is forced to be used for CPU idle.
                        In such case C2/C3 won't be used again.
                        idle=nomwait: Disable mwait for CPU C-states
                        0       disables intel_idle and fall back on acpi_idle.
                        1 to 6  specify maximum depth of C-state.
  
 +      intel_pstate=  [X86]
 +                     disable
 +                       Do not enable intel_pstate as the default
 +                       scaling driver for the supported processors
 +
        intremap=       [X86-64, Intel-IOMMU]
                        on      enable Interrupt Remapping (default)
                        off     disable Interrupt Remapping
                        wfi(ARM) instruction doesn't work correctly and not to
                        use it. This is also useful when using JTAG debugger.
  
-       no-hlt          [BUGS=X86-32] Tells the kernel that the hlt
-                       instruction doesn't work correctly and not to
-                       use it.
        no_file_caps    Tells the kernel not to honor file capabilities.  The
                        only way then for a file to be executed with privilege
                        is to be setuid root or executed by root.
                        real-time workloads.  It can also improve energy
                        efficiency for asymmetric multiprocessors.
  
 -      rcu_nocbs_poll  [KNL,BOOT]
 +      rcu_nocb_poll   [KNL,BOOT]
                        Rather than requiring that offloaded CPUs
                        (specified by rcu_nocbs= above) explicitly
                        awaken the corresponding "rcuoN" kthreads,
diff --combined arch/x86/Kconfig
@@@ -454,16 -454,6 +454,16 @@@ config X86_MDFL
  
  endif
  
 +config X86_INTEL_LPSS
 +      bool "Intel Low Power Subsystem Support"
 +      depends on ACPI
 +      select COMMON_CLK
 +      ---help---
 +        Select to build support for Intel Low Power Subsystem such as
 +        found on Intel Lynxpoint PCH. Selecting this option enables
 +        things like clock tree (common clock framework) which are needed
 +        by the LPSS peripheral drivers.
 +
  config X86_RDC321X
        bool "RDC R-321x SoC"
        depends on X86_32
@@@ -1922,6 -1912,7 +1922,7 @@@ config APM_DO_ENABL
          this feature.
  
  config APM_CPU_IDLE
+       depends on CPU_IDLE
        bool "Make CPU Idle calls when idle"
        ---help---
          Enable calls to APM CPU Idle/CPU Busy inside the kernel's idle loop.
@@@ -268,13 -268,7 +268,7 @@@ void __switch_to_xtra(struct task_struc
  unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
  EXPORT_SYMBOL(boot_option_idle_override);
  
- /*
-  * Powermanagement idle function, if any..
-  */
- void (*pm_idle)(void);
- #ifdef CONFIG_APM_MODULE
- EXPORT_SYMBOL(pm_idle);
- #endif
+ static void (*x86_idle)(void);
  
  #ifndef CONFIG_SMP
  static inline void play_dead(void)
@@@ -351,7 -345,7 +345,7 @@@ void cpu_idle(void
                        rcu_idle_enter();
  
                        if (cpuidle_idle_call())
-                               pm_idle();
+                               x86_idle();
  
                        rcu_idle_exit();
                        start_critical_timings();
   */
  void default_idle(void)
  {
 -      trace_power_start_rcuidle(POWER_CSTATE, 1, smp_processor_id());
        trace_cpu_idle_rcuidle(1, smp_processor_id());
        current_thread_info()->status &= ~TS_POLLING;
        /*
        else
                local_irq_enable();
        current_thread_info()->status |= TS_POLLING;
 -      trace_power_end_rcuidle(smp_processor_id());
        trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
  }
  #ifdef CONFIG_APM_MODULE
  EXPORT_SYMBOL(default_idle);
  #endif
  
- bool set_pm_idle_to_default(void)
+ #ifdef CONFIG_XEN
+ bool xen_set_default_idle(void)
  {
-       bool ret = !!pm_idle;
+       bool ret = !!x86_idle;
  
-       pm_idle = default_idle;
+       x86_idle = default_idle;
  
        return ret;
  }
+ #endif
  void stop_this_cpu(void *dummy)
  {
        local_irq_disable();
        set_cpu_online(smp_processor_id(), false);
        disable_local_APIC();
  
-       for (;;) {
-               if (hlt_works(smp_processor_id()))
-                       halt();
-       }
- }
- /* Default MONITOR/MWAIT with no hints, used for default C1 state */
- static void mwait_idle(void)
- {
-       if (!need_resched()) {
-               trace_cpu_idle_rcuidle(1, smp_processor_id());
-               if (this_cpu_has(X86_FEATURE_CLFLUSH_MONITOR))
-                       clflush((void *)&current_thread_info()->flags);
-               __monitor((void *)&current_thread_info()->flags, 0, 0);
-               smp_mb();
-               if (!need_resched())
-                       __sti_mwait(0, 0);
-               else
-                       local_irq_enable();
-               trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
-       } else
-               local_irq_enable();
+       for (;;)
+               halt();
  }
  
  /*
   */
  static void poll_idle(void)
  {
 -      trace_power_start_rcuidle(POWER_CSTATE, 0, smp_processor_id());
        trace_cpu_idle_rcuidle(0, smp_processor_id());
        local_irq_enable();
        while (!need_resched())
                cpu_relax();
 -      trace_power_end_rcuidle(smp_processor_id());
        trace_cpu_idle_rcuidle(PWR_EVENT_EXIT, smp_processor_id());
  }
  
- /*
-  * mwait selection logic:
-  *
-  * It depends on the CPU. For AMD CPUs that support MWAIT this is
-  * wrong. Family 0x10 and 0x11 CPUs will enter C1 on HLT. Powersavings
-  * then depend on a clock divisor and current Pstate of the core. If
-  * all cores of a processor are in halt state (C1) the processor can
-  * enter the C1E (C1 enhanced) state. If mwait is used this will never
-  * happen.
-  *
-  * idle=mwait overrides this decision and forces the usage of mwait.
-  */
- #define MWAIT_INFO                    0x05
- #define MWAIT_ECX_EXTENDED_INFO               0x01
- #define MWAIT_EDX_C1                  0xf0
- int mwait_usable(const struct cpuinfo_x86 *c)
- {
-       u32 eax, ebx, ecx, edx;
-       /* Use mwait if idle=mwait boot option is given */
-       if (boot_option_idle_override == IDLE_FORCE_MWAIT)
-               return 1;
-       /*
-        * Any idle= boot option other than idle=mwait means that we must not
-        * use mwait. Eg: idle=halt or idle=poll or idle=nomwait
-        */
-       if (boot_option_idle_override != IDLE_NO_OVERRIDE)
-               return 0;
-       if (c->cpuid_level < MWAIT_INFO)
-               return 0;
-       cpuid(MWAIT_INFO, &eax, &ebx, &ecx, &edx);
-       /* Check, whether EDX has extended info about MWAIT */
-       if (!(ecx & MWAIT_ECX_EXTENDED_INFO))
-               return 1;
-       /*
-        * edx enumeratios MONITOR/MWAIT extensions. Check, whether
-        * C1  supports MWAIT
-        */
-       return (edx & MWAIT_EDX_C1);
- }
  bool amd_e400_c1e_detected;
  EXPORT_SYMBOL(amd_e400_c1e_detected);
  
@@@ -561,31 -493,24 +489,24 @@@ static void amd_e400_idle(void
  void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
  {
  #ifdef CONFIG_SMP
-       if (pm_idle == poll_idle && smp_num_siblings > 1) {
+       if (x86_idle == poll_idle && smp_num_siblings > 1)
                pr_warn_once("WARNING: polling idle and HT enabled, performance may degrade\n");
-       }
  #endif
-       if (pm_idle)
+       if (x86_idle)
                return;
  
-       if (cpu_has(c, X86_FEATURE_MWAIT) && mwait_usable(c)) {
-               /*
-                * One CPU supports mwait => All CPUs supports mwait
-                */
-               pr_info("using mwait in idle threads\n");
-               pm_idle = mwait_idle;
-       } else if (cpu_has_amd_erratum(amd_erratum_400)) {
+       if (cpu_has_amd_erratum(amd_erratum_400)) {
                /* E400: APIC timer interrupt does not wake up CPU from C1e */
                pr_info("using AMD E400 aware idle routine\n");
-               pm_idle = amd_e400_idle;
+               x86_idle = amd_e400_idle;
        } else
-               pm_idle = default_idle;
+               x86_idle = default_idle;
  }
  
  void __init init_amd_e400_c1e_mask(void)
  {
        /* If we're using amd_e400_idle, we need to allocate amd_e400_c1e_mask. */
-       if (pm_idle == amd_e400_idle)
+       if (x86_idle == amd_e400_idle)
                zalloc_cpumask_var(&amd_e400_c1e_mask, GFP_KERNEL);
  }
  
@@@ -596,11 -521,8 +517,8 @@@ static int __init idle_setup(char *str
  
        if (!strcmp(str, "poll")) {
                pr_info("using polling idle threads\n");
-               pm_idle = poll_idle;
+               x86_idle = poll_idle;
                boot_option_idle_override = IDLE_POLL;
-       } else if (!strcmp(str, "mwait")) {
-               boot_option_idle_override = IDLE_FORCE_MWAIT;
-               WARN_ONCE(1, "\"idle=mwait\" will be removed in 2012\n");
        } else if (!strcmp(str, "halt")) {
                /*
                 * When the boot option of idle=halt is added, halt is
                 * To continue to load the CPU idle driver, don't touch
                 * the boot_option_idle_override.
                 */
-               pm_idle = default_idle;
+               x86_idle = default_idle;
                boot_option_idle_override = IDLE_HALT;
        } else if (!strcmp(str, "nomwait")) {
                /*