Merge branch 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2016 02:15:35 +0000 (19:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 26 Jul 2016 02:15:35 +0000 (19:15 -0700)
Pull x86 platform updates from Ingo Molnar:
 "The main changes in this cycle were:

   - Intel-SoC enhancements (Andy Shevchenko)

   - Intel CPU symbolic model definition rework (Dave Hansen)

   - ... other misc changes"

* 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (25 commits)
  x86/sfi: Enable enumeration of SD devices
  x86/pci: Use MRFLD abbreviation for Merrifield
  x86/platform/intel-mid: Make vertical indentation consistent
  x86/platform/intel-mid: Mark regulators explicitly defined
  x86/platform/intel-mid: Rename mrfl.c to mrfld.c
  x86/platform/intel-mid: Enable spidev on Intel Edison boards
  x86/platform/intel-mid: Extend PWRMU to support Penwell
  x86/pci, x86/platform/intel_mid_pci: Remove duplicate power off code
  x86/platform/intel-mid: Add pinctrl for Intel Merrifield
  x86/platform/intel-mid: Enable GPIO expanders on Edison
  x86/platform/intel-mid: Add Power Management Unit driver
  x86/platform/atom/punit: Enable support for Merrifield
  x86/platform/intel_mid_pci: Rework IRQ0 workaround
  x86, thermal: Clean up and fix CPU model detection for intel_soc_dts_thermal
  x86, mmc: Use Intel family name macros for mmc driver
  x86/intel_telemetry: Use Intel family name macros for telemetry driver
  x86/acpi/lss: Use Intel family name macros for the acpi_lpss driver
  x86/cpufreq: Use Intel family name macros for the intel_pstate cpufreq driver
  x86/platform: Use new Intel model number macros
  x86/intel_idle: Use Intel family macros for intel_idle
  ...

1  2 
arch/x86/include/asm/topology.h
drivers/cpufreq/intel_pstate.c

  #ifndef _ASM_X86_TOPOLOGY_H
  #define _ASM_X86_TOPOLOGY_H
  
- #ifdef CONFIG_X86_32
- # ifdef CONFIG_SMP
- #  define ENABLE_TOPO_DEFINES
- # endif
- #else
- # ifdef CONFIG_SMP
- #  define ENABLE_TOPO_DEFINES
- # endif
- #endif
  /*
   * to preserve the visibility of NUMA_NO_NODE definition,
   * moved to there from here.  May be used independent of
@@@ -123,20 -113,12 +113,20 @@@ extern const struct cpumask *cpu_coregr
  #define topology_physical_package_id(cpu)     (cpu_data(cpu).phys_proc_id)
  #define topology_core_id(cpu)                 (cpu_data(cpu).cpu_core_id)
  
- #ifdef ENABLE_TOPO_DEFINES
+ #ifdef CONFIG_SMP
  #define topology_core_cpumask(cpu)            (per_cpu(cpu_core_map, cpu))
  #define topology_sibling_cpumask(cpu)         (per_cpu(cpu_sibling_map, cpu))
  
  extern unsigned int __max_logical_packages;
  #define topology_max_packages()                       (__max_logical_packages)
 +
 +extern int __max_smt_threads;
 +
 +static inline int topology_max_smt_threads(void)
 +{
 +      return __max_smt_threads;
 +}
 +
  int topology_update_package_map(unsigned int apicid, unsigned int cpu);
  extern int topology_phys_to_logical_pkg(unsigned int pkg);
  #else
  static inline int
  topology_update_package_map(unsigned int apicid, unsigned int cpu) { return 0; }
  static inline int topology_phys_to_logical_pkg(unsigned int pkg) { return 0; }
 +static inline int topology_max_smt_threads(void) { return 1; }
  #endif
  
  static inline void arch_fix_phys_package_id(int num, u32 slot)
@@@ -35,6 -35,7 +35,7 @@@
  #include <asm/msr.h>
  #include <asm/cpu_device_id.h>
  #include <asm/cpufeature.h>
+ #include <asm/intel-family.h>
  
  #define ATOM_RATIOS           0x66a
  #define ATOM_VIDS             0x66b
@@@ -372,9 -373,26 +373,9 @@@ static bool intel_pstate_get_ppc_enable
        return acpi_ppc;
  }
  
 -/*
 - * The max target pstate ratio is a 8 bit value in both PLATFORM_INFO MSR and
 - * in TURBO_RATIO_LIMIT MSR, which pstate driver stores in max_pstate and
 - * max_turbo_pstate fields. The PERF_CTL MSR contains 16 bit value for P state
 - * ratio, out of it only high 8 bits are used. For example 0x1700 is setting
 - * target ratio 0x17. The _PSS control value stores in a format which can be
 - * directly written to PERF_CTL MSR. But in intel_pstate driver this shift
 - * occurs during write to PERF_CTL (E.g. for cores core_set_pstate()).
 - * This function converts the _PSS control value to intel pstate driver format
 - * for comparison and assignment.
 - */
 -static int convert_to_native_pstate_format(struct cpudata *cpu, int index)
 -{
 -      return cpu->acpi_perf_data.states[index].control >> 8;
 -}
 -
  static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy)
  {
        struct cpudata *cpu;
 -      int turbo_pss_ctl;
        int ret;
        int i;
  
         * max frequency, which will cause a reduced performance as
         * this driver uses real max turbo frequency as the max
         * frequency. So correct this frequency in _PSS table to
 -       * correct max turbo frequency based on the turbo ratio.
 +       * correct max turbo frequency based on the turbo state.
         * Also need to convert to MHz as _PSS freq is in MHz.
         */
 -      turbo_pss_ctl = convert_to_native_pstate_format(cpu, 0);
 -      if (turbo_pss_ctl > cpu->pstate.max_pstate)
 +      if (!limits->turbo_disabled)
                cpu->acpi_perf_data.states[0].core_frequency =
                                        policy->cpuinfo.max_freq / 1000;
        cpu->valid_pss_table = true;
@@@ -1334,29 -1353,29 +1335,29 @@@ static void intel_pstate_update_util(st
                        (unsigned long)&policy }
  
  static const struct x86_cpu_id intel_pstate_cpu_ids[] = {
-       ICPU(0x2a, core_params),
-       ICPU(0x2d, core_params),
-       ICPU(0x37, silvermont_params),
-       ICPU(0x3a, core_params),
-       ICPU(0x3c, core_params),
-       ICPU(0x3d, core_params),
-       ICPU(0x3e, core_params),
-       ICPU(0x3f, core_params),
-       ICPU(0x45, core_params),
-       ICPU(0x46, core_params),
-       ICPU(0x47, core_params),
-       ICPU(0x4c, airmont_params),
-       ICPU(0x4e, core_params),
-       ICPU(0x4f, core_params),
-       ICPU(0x5e, core_params),
-       ICPU(0x56, core_params),
-       ICPU(0x57, knl_params),
+       ICPU(INTEL_FAM6_SANDYBRIDGE,            core_params),
+       ICPU(INTEL_FAM6_SANDYBRIDGE_X,          core_params),
+       ICPU(INTEL_FAM6_ATOM_SILVERMONT1,       silvermont_params),
+       ICPU(INTEL_FAM6_IVYBRIDGE,              core_params),
+       ICPU(INTEL_FAM6_HASWELL_CORE,           core_params),
+       ICPU(INTEL_FAM6_BROADWELL_CORE,         core_params),
+       ICPU(INTEL_FAM6_IVYBRIDGE_X,            core_params),
+       ICPU(INTEL_FAM6_HASWELL_X,              core_params),
+       ICPU(INTEL_FAM6_HASWELL_ULT,            core_params),
+       ICPU(INTEL_FAM6_HASWELL_GT3E,           core_params),
+       ICPU(INTEL_FAM6_BROADWELL_GT3E,         core_params),
+       ICPU(INTEL_FAM6_ATOM_AIRMONT,           airmont_params),
+       ICPU(INTEL_FAM6_SKYLAKE_MOBILE,         core_params),
+       ICPU(INTEL_FAM6_BROADWELL_X,            core_params),
+       ICPU(INTEL_FAM6_SKYLAKE_DESKTOP,        core_params),
+       ICPU(INTEL_FAM6_BROADWELL_XEON_D,       core_params),
+       ICPU(INTEL_FAM6_XEON_PHI_KNL,           knl_params),
        {}
  };
  MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
  
  static const struct x86_cpu_id intel_pstate_cpu_oob_ids[] = {
-       ICPU(0x56, core_params),
+       ICPU(INTEL_FAM6_BROADWELL_XEON_D, core_params),
        {}
  };
  
@@@ -1400,9 -1419,6 +1401,9 @@@ static void intel_pstate_set_update_uti
  {
        struct cpudata *cpu = all_cpu_data[cpu_num];
  
 +      if (cpu->update_util_set)
 +              return;
 +
        /* Prevent intel_pstate_update_util() from using stale data. */
        cpu->sample.time = 0;
        cpufreq_add_update_util_hook(cpu_num, &cpu->update_util,
@@@ -1443,6 -1459,8 +1444,6 @@@ static int intel_pstate_set_policy(stru
        if (!policy->cpuinfo.max_freq)
                return -ENODEV;
  
 -      intel_pstate_clear_update_util_hook(policy->cpu);
 -
        pr_debug("set_policy cpuinfo.max %u policy->max %u\n",
                 policy->cpuinfo.max_freq, policy->max);