diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-21 17:58:34 +0900 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-05-21 17:58:34 +0900 | 
| commit | 478c7cf7a8ff7ad587bd76f8ce9cfeede0df45fb (patch) | |
| tree | ba287759f6b1d66e804ccab8c038897c10b53d70 /drivers/cpufreq | |
| parent | 23de4a7af7bc3d687f783a612b8e824865b7e6ce (diff) | |
| parent | 658a0f4e661a6c07395de318a58f9058ba2faf8f (diff) | |
| download | linux-478c7cf7a8ff7ad587bd76f8ce9cfeede0df45fb.tar.bz2 | |
Merge tag 'pm+acpi-3.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management fixes from Rafael Wysocki:
 "Still fixing regressions (partly by reverting commits that broke
  things for people), fixing other stable-candidate bugs and adding some
  blacklist entries for ACPI video and _OSI.
  Two ACPICA regression fixes (one recent and one for a 3.14 commit), a
  fix for an ACPI-related regression in TPM (introduced in 3.14), a
  revert of the ACPI AC driver conversion in 3.13 that went wrong for an
  unknown reason, two reverts of commits that attempted to remove an old
  user space interface in /proc and broke some utilities, in 3.13 too, a
  fix for a CPU hotplug bug in the ACPI processor driver (stable
  material), two (stable candidate) fixes for intel_pstate and a few new
  blacklist entries, mostly for systems that shipped with Windows 8.
  Specifics:
   - ACPICA fix for a stale pointer access introduced by a recent commit
     in the XSDT validation code from Lv Zheng.
   - ACPICA fix for the default value of the command line switch to
     favor 32-bit FADT addresses (in case there's a conflict between a
     64-bit and a 32-bit address).  The previous default was that the
     32-bit version would take precedence and we tried to change it to
     the other way around and it didn't work.  From Lv Zheng.
   - A TPM commit related to ACPI _DSM in 3.14 caused the driver to
     refuse to load if a specific _DSM was missing and that broke resume
     from system suspend on Chromebooks that require the TPM hardware to
     be restored to a working state during resume by the OS.  Restore
     the old behavior to load the driver if the _DSM in question is not
     present, but prevent it from using the feature the _DSM is for.
   - ACPI AC driver conversion in 3.13 broke thermal management on at
     least one machine and has to be reverted.  From Guenter Roeck.
   - Two reverts of 3.13 commits that attempted to remove the old ACPI
     battery interface in /proc, but turned out to break some utilities
     still using that interface.  From Lan Tianyu.
   - ACPI processor driver fix to prevent acpi_processor_add() from
     modifying the CPU device's .offline field which leads to breakage
     if the initial online of the CPU fails.  From Igor Mammedov.
   - Two intel_pstate fixes, one to take a BayTrail documentation update
     into account and one to avoid forcing the maximum P-state on init
     which causes CPU PM trouble on systems with P-states coordination
     when one of the CPU cores is initialized after an offline/online
     cycle triggered by user space.  Both stable candidates, from Dirk
     Brandewie.
   - Fix for the ACPI video DMI blacklist entry for Dell Inspiron 7520
     from Aaron Lu.
   - Two new ACPI video blacklist entries for machines shipping with
     Win8 that need to use native backlight so that it can be controlled
     in a usual way (which doesn't work otherwise due bugs in the ACPI
     tables) from Hans de Goede.
   - Two ACPI _OSI quirks for systems that need them to work correctly
     with Linux from Edward Lin and Hans de Goede"
* tag 'pm+acpi-3.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI / video: Revert native brightness quirk for ThinkPad T530
  intel_pstate: remove setting P state to MAX on init
  ACPICA: Tables: Restore old behavor to favor 32-bit FADT addresses.
  ACPI / video: correct DMI tag for Dell Inspiron 7520
  intel_pstate: Set turbo VID for BayTrail
  ACPI / TPM: Fix resume regression on Chromebooks
  ACPI / proc: Do not say when /proc interfaces will be deleted in Kconfig
  ACPI / processor: do not mark present at boot but not onlined CPU as onlined
  ACPI: Revert "ACPI / AC: convert ACPI ac driver to platform bus"
  ACPI / blacklist: Add dmi_enable_osi_linux quirk for Asus EEE PC 1015PX
  ACPI: blacklist win8 OSI for Dell Inspiron 7737
  ACPI / video: Add use_native_backlight quirks for more systems
  ACPI: Revert "ACPI / Battery: Remove battery's proc directory"
  ACPI: Revert "ACPI: Remove CONFIG_ACPI_PROCFS_POWER and cm_sbsc.c"
  ACPICA: Tables: Fix invalid pointer accesses in acpi_tb_parse_root_table().
Diffstat (limited to 'drivers/cpufreq')
| -rw-r--r-- | drivers/cpufreq/intel_pstate.c | 34 | 
1 files changed, 16 insertions, 18 deletions
| diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 099967302bf2..eab8ccfe6beb 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -37,6 +37,7 @@  #define BYT_RATIOS		0x66a  #define BYT_VIDS		0x66b  #define BYT_TURBO_RATIOS	0x66c +#define BYT_TURBO_VIDS		0x66d  #define FRAC_BITS 6 @@ -70,8 +71,9 @@ struct pstate_data {  };  struct vid_data { -	int32_t min; -	int32_t max; +	int min; +	int max; +	int turbo;  	int32_t ratio;  }; @@ -359,14 +361,14 @@ static int byt_get_min_pstate(void)  {  	u64 value;  	rdmsrl(BYT_RATIOS, value); -	return (value >> 8) & 0xFF; +	return (value >> 8) & 0x3F;  }  static int byt_get_max_pstate(void)  {  	u64 value;  	rdmsrl(BYT_RATIOS, value); -	return (value >> 16) & 0xFF; +	return (value >> 16) & 0x3F;  }  static int byt_get_turbo_pstate(void) @@ -393,6 +395,9 @@ static void byt_set_pstate(struct cpudata *cpudata, int pstate)  	vid_fp = clamp_t(int32_t, vid_fp, cpudata->vid.min, cpudata->vid.max);  	vid = fp_toint(vid_fp); +	if (pstate > cpudata->pstate.max_pstate) +		vid = cpudata->vid.turbo; +  	val |= vid;  	wrmsrl(MSR_IA32_PERF_CTL, val); @@ -402,13 +407,17 @@ static void byt_get_vid(struct cpudata *cpudata)  {  	u64 value; +  	rdmsrl(BYT_VIDS, value); -	cpudata->vid.min = int_tofp((value >> 8) & 0x7f); -	cpudata->vid.max = int_tofp((value >> 16) & 0x7f); +	cpudata->vid.min = int_tofp((value >> 8) & 0x3f); +	cpudata->vid.max = int_tofp((value >> 16) & 0x3f);  	cpudata->vid.ratio = div_fp(  		cpudata->vid.max - cpudata->vid.min,  		int_tofp(cpudata->pstate.max_pstate -  			cpudata->pstate.min_pstate)); + +	rdmsrl(BYT_TURBO_VIDS, value); +	cpudata->vid.turbo = value & 0x7f;  } @@ -545,12 +554,7 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)  	if (pstate_funcs.get_vid)  		pstate_funcs.get_vid(cpu); - -	/* -	 * goto max pstate so we don't slow up boot if we are built-in if we are -	 * a module we will take care of it during normal operation -	 */ -	intel_pstate_set_pstate(cpu, cpu->pstate.max_pstate); +	intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate);  }  static inline void intel_pstate_calc_busy(struct cpudata *cpu, @@ -695,11 +699,6 @@ static int intel_pstate_init_cpu(unsigned int cpunum)  	cpu = all_cpu_data[cpunum];  	intel_pstate_get_cpu_pstates(cpu); -	if (!cpu->pstate.current_pstate) { -		all_cpu_data[cpunum] = NULL; -		kfree(cpu); -		return -ENODATA; -	}  	cpu->cpu = cpunum; @@ -710,7 +709,6 @@ static int intel_pstate_init_cpu(unsigned int cpunum)  	cpu->timer.expires = jiffies + HZ/100;  	intel_pstate_busy_pid_reset(cpu);  	intel_pstate_sample(cpu); -	intel_pstate_set_pstate(cpu, cpu->pstate.max_pstate);  	add_timer_on(&cpu->timer, cpunum); |