]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 18:45:26 +0000 (10:45 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2014 18:45:26 +0000 (10:45 -0800)
added patches:
intel_pstate-add-haswell-cpu-models.patch
intel_pstate-correct-calculation-of-min-pstate-value.patch
intel_pstate-fix-no_turbo.patch
intel_pstate-improve-accuracy-by-not-truncating-until-final-result.patch

queue-3.10/intel_pstate-add-haswell-cpu-models.patch [new file with mode: 0644]
queue-3.10/intel_pstate-correct-calculation-of-min-pstate-value.patch [new file with mode: 0644]
queue-3.10/intel_pstate-fix-no_turbo.patch [new file with mode: 0644]
queue-3.10/intel_pstate-improve-accuracy-by-not-truncating-until-final-result.patch [new file with mode: 0644]
queue-3.10/series

diff --git a/queue-3.10/intel_pstate-add-haswell-cpu-models.patch b/queue-3.10/intel_pstate-add-haswell-cpu-models.patch
new file mode 100644 (file)
index 0000000..8d77437
--- /dev/null
@@ -0,0 +1,37 @@
+From 6cdcdb793791f776ea9408581b1242b636d43b37 Mon Sep 17 00:00:00 2001
+From: Nell Hardcastle <nell@spicious.com>
+Date: Sun, 30 Jun 2013 15:58:57 -0700
+Subject: intel_pstate: Add Haswell CPU models
+
+From: Nell Hardcastle <nell@spicious.com>
+
+commit 6cdcdb793791f776ea9408581b1242b636d43b37 upstream.
+
+Enable the intel_pstate driver for Haswell CPUs. One missing Ivy Bridge
+model (0x3E) is also included. Models referenced from
+tools/power/x86/turbostat/turbostat.c:has_nehalem_turbo_ratio_limit
+
+Signed-off-by: Nell Hardcastle <nell@spicious.com>
+Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
+Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/intel_pstate.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/cpufreq/intel_pstate.c
++++ b/drivers/cpufreq/intel_pstate.c
+@@ -523,6 +523,11 @@ static const struct x86_cpu_id intel_pst
+       ICPU(0x2a, default_policy),
+       ICPU(0x2d, default_policy),
+       ICPU(0x3a, default_policy),
++      ICPU(0x3c, default_policy),
++      ICPU(0x3e, default_policy),
++      ICPU(0x3f, default_policy),
++      ICPU(0x45, default_policy),
++      ICPU(0x46, default_policy),
+       {}
+ };
+ MODULE_DEVICE_TABLE(x86cpu, intel_pstate_cpu_ids);
diff --git a/queue-3.10/intel_pstate-correct-calculation-of-min-pstate-value.patch b/queue-3.10/intel_pstate-correct-calculation-of-min-pstate-value.patch
new file mode 100644 (file)
index 0000000..5101c0c
--- /dev/null
@@ -0,0 +1,39 @@
+From 7244cb62d96e735847dc9d08f870550df896898c Mon Sep 17 00:00:00 2001
+From: Dirk Brandewie <dirk.j.brandewie@intel.com>
+Date: Mon, 21 Oct 2013 09:20:33 -0700
+Subject: intel_pstate: Correct calculation of min pstate value
+
+From: Dirk Brandewie <dirk.j.brandewie@intel.com>
+
+commit 7244cb62d96e735847dc9d08f870550df896898c upstream.
+
+The minimum pstate is supposed to be a percentage of the maximum P
+state available.  Calculate min using max pstate and not the
+current max which may have been limited by the user
+
+Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/intel_pstate.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/cpufreq/intel_pstate.c
++++ b/drivers/cpufreq/intel_pstate.c
+@@ -366,12 +366,13 @@ static int intel_pstate_turbo_pstate(voi
+ static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max)
+ {
+       int max_perf = cpu->pstate.turbo_pstate;
++      int max_perf_adj;
+       int min_perf;
+       if (limits.no_turbo)
+               max_perf = cpu->pstate.max_pstate;
+-      max_perf = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf));
+-      *max = clamp_t(int, max_perf,
++      max_perf_adj = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf));
++      *max = clamp_t(int, max_perf_adj,
+                       cpu->pstate.min_pstate, cpu->pstate.turbo_pstate);
+       min_perf = fp_toint(mul_fp(int_tofp(max_perf), limits.min_perf));
diff --git a/queue-3.10/intel_pstate-fix-no_turbo.patch b/queue-3.10/intel_pstate-fix-no_turbo.patch
new file mode 100644 (file)
index 0000000..b19d41c
--- /dev/null
@@ -0,0 +1,36 @@
+From 1ccf7a1cdafadd02e33e8f3d74370685a0600ec6 Mon Sep 17 00:00:00 2001
+From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Date: Tue, 1 Oct 2013 10:28:41 -0700
+Subject: intel_pstate: fix no_turbo
+
+From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+
+commit 1ccf7a1cdafadd02e33e8f3d74370685a0600ec6 upstream.
+
+When sysfs for no_turbo is set, then also some p states in turbo regions
+are observed. This patch will set IDA Engage bit when no_turbo is set to
+explicitly disengage turbo.
+
+Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/intel_pstate.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/drivers/cpufreq/intel_pstate.c
++++ b/drivers/cpufreq/intel_pstate.c
+@@ -394,7 +394,10 @@ static void intel_pstate_set_pstate(stru
+       trace_cpu_frequency(pstate * 100000, cpu->cpu);
+       cpu->pstate.current_pstate = pstate;
+-      wrmsrl(MSR_IA32_PERF_CTL, pstate << 8);
++      if (limits.no_turbo)
++              wrmsrl(MSR_IA32_PERF_CTL, BIT(32) | (pstate << 8));
++      else
++              wrmsrl(MSR_IA32_PERF_CTL, pstate << 8);
+ }
diff --git a/queue-3.10/intel_pstate-improve-accuracy-by-not-truncating-until-final-result.patch b/queue-3.10/intel_pstate-improve-accuracy-by-not-truncating-until-final-result.patch
new file mode 100644 (file)
index 0000000..22732f8
--- /dev/null
@@ -0,0 +1,119 @@
+From d253d2a52676cfa3d89b8f0737a08ce7db665207 Mon Sep 17 00:00:00 2001
+From: Brennan Shacklett <brennan@genyes.org>
+Date: Mon, 21 Oct 2013 09:20:32 -0700
+Subject: intel_pstate: Improve accuracy by not truncating until final result
+
+From: Brennan Shacklett <brennan@genyes.org>
+
+commit d253d2a52676cfa3d89b8f0737a08ce7db665207 upstream.
+
+This patch addresses Bug 60727
+(https://bugzilla.kernel.org/show_bug.cgi?id=60727)
+which was due to the truncation of intermediate values in the
+calculations, which causes the code to consistently underestimate the
+current cpu frequency, specifically 100% cpu utilization was truncated
+down to the setpoint of 97%. This patch fixes the problem by keeping
+the results of all intermediate calculations as fixed point numbers
+rather scaling them back and forth between integers and fixed point.
+
+References: https://bugzilla.kernel.org/show_bug.cgi?id=60727
+Signed-off-by: Brennan Shacklett <bpshacklett@gmail.com>
+Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/intel_pstate.c |   33 +++++++++++++++------------------
+ 1 file changed, 15 insertions(+), 18 deletions(-)
+
+--- a/drivers/cpufreq/intel_pstate.c
++++ b/drivers/cpufreq/intel_pstate.c
+@@ -48,7 +48,7 @@ static inline int32_t div_fp(int32_t x,
+ }
+ struct sample {
+-      int core_pct_busy;
++      int32_t core_pct_busy;
+       u64 aperf;
+       u64 mperf;
+       int freq;
+@@ -68,7 +68,7 @@ struct _pid {
+       int32_t i_gain;
+       int32_t d_gain;
+       int deadband;
+-      int last_err;
++      int32_t last_err;
+ };
+ struct cpudata {
+@@ -153,16 +153,15 @@ static inline void pid_d_gain_set(struct
+       pid->d_gain = div_fp(int_tofp(percent), int_tofp(100));
+ }
+-static signed int pid_calc(struct _pid *pid, int busy)
++static signed int pid_calc(struct _pid *pid, int32_t busy)
+ {
+-      signed int err, result;
++      signed int result;
+       int32_t pterm, dterm, fp_error;
+       int32_t integral_limit;
+-      err = pid->setpoint - busy;
+-      fp_error = int_tofp(err);
++      fp_error = int_tofp(pid->setpoint) - busy;
+-      if (abs(err) <= pid->deadband)
++      if (abs(fp_error) <= int_tofp(pid->deadband))
+               return 0;
+       pterm = mul_fp(pid->p_gain, fp_error);
+@@ -176,8 +175,8 @@ static signed int pid_calc(struct _pid *
+       if (pid->integral < -integral_limit)
+               pid->integral = -integral_limit;
+-      dterm = mul_fp(pid->d_gain, (err - pid->last_err));
+-      pid->last_err = err;
++      dterm = mul_fp(pid->d_gain, fp_error - pid->last_err);
++      pid->last_err = fp_error;
+       result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm;
+@@ -435,8 +434,9 @@ static inline void intel_pstate_calc_bus
+                                       struct sample *sample)
+ {
+       u64 core_pct;
+-      core_pct = div64_u64(sample->aperf * 100, sample->mperf);
+-      sample->freq = cpu->pstate.max_pstate * core_pct * 1000;
++      core_pct = div64_u64(int_tofp(sample->aperf * 100),
++                           sample->mperf);
++      sample->freq = fp_toint(cpu->pstate.max_pstate * core_pct * 1000);
+       sample->core_pct_busy = core_pct;
+ }
+@@ -468,22 +468,19 @@ static inline void intel_pstate_set_samp
+       mod_timer_pinned(&cpu->timer, jiffies + delay);
+ }
+-static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu)
++static inline int32_t intel_pstate_get_scaled_busy(struct cpudata *cpu)
+ {
+-      int32_t busy_scaled;
+       int32_t core_busy, max_pstate, current_pstate;
+-      core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy);
++      core_busy = cpu->samples[cpu->sample_ptr].core_pct_busy;
+       max_pstate = int_tofp(cpu->pstate.max_pstate);
+       current_pstate = int_tofp(cpu->pstate.current_pstate);
+-      busy_scaled = mul_fp(core_busy, div_fp(max_pstate, current_pstate));
+-
+-      return fp_toint(busy_scaled);
++      return mul_fp(core_busy, div_fp(max_pstate, current_pstate));
+ }
+ static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu)
+ {
+-      int busy_scaled;
++      int32_t busy_scaled;
+       struct _pid *pid;
+       signed int ctl = 0;
+       int steps;
index ad4649baa20cf06d028bb07bc9235c85c2585951..4d0a93e71d8c4373d5093981f9177425097a1377 100644 (file)
@@ -73,3 +73,7 @@ timekeeping-fix-clock_tai-timer-nanosleep-delays.patch
 timekeeping-fix-missing-timekeeping_update-in-suspend-path.patch
 rtc-cmos-add-an-alarm-disable-quirk.patch
 timekeeping-avoid-possible-deadlock-from-clock_was_set_delayed.patch
+intel_pstate-add-haswell-cpu-models.patch
+intel_pstate-fix-no_turbo.patch
+intel_pstate-improve-accuracy-by-not-truncating-until-final-result.patch
+intel_pstate-correct-calculation-of-min-pstate-value.patch