aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/intel_pstate.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-05-09 15:59:24 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-09 15:59:24 -0400
commite800072c18f0d7b89a80fa46dceb3d080c80e09c (patch)
tree8da6cb7944762a60ec37594720c1ad2757631c2f /drivers/cpufreq/intel_pstate.c
parente8ed77dfa90dd79c5343415a4bbbfdab9787b35a (diff)
parentb507146bb6b9ac0c0197100ba3e299825a21fed3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
In netdevice.h we removed the structure in net-next that is being changes in 'net'. In macsec.c and rtnetlink.c we have overlaps between fixes in 'net' and the u64 attribute changes in 'net-next'. The mlx5 conflicts have to do with vxlan support dependencies. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/cpufreq/intel_pstate.c')
-rw-r--r--drivers/cpufreq/intel_pstate.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index f502d5b90c25..b230ebaae66c 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -453,6 +453,14 @@ static void intel_pstate_hwp_set(const struct cpumask *cpumask)
453 } 453 }
454} 454}
455 455
456static int intel_pstate_hwp_set_policy(struct cpufreq_policy *policy)
457{
458 if (hwp_active)
459 intel_pstate_hwp_set(policy->cpus);
460
461 return 0;
462}
463
456static void intel_pstate_hwp_set_online_cpus(void) 464static void intel_pstate_hwp_set_online_cpus(void)
457{ 465{
458 get_online_cpus(); 466 get_online_cpus();
@@ -1062,8 +1070,9 @@ static inline bool intel_pstate_sample(struct cpudata *cpu, u64 time)
1062 1070
1063static inline int32_t get_avg_frequency(struct cpudata *cpu) 1071static inline int32_t get_avg_frequency(struct cpudata *cpu)
1064{ 1072{
1065 return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf * 1073 return fp_toint(mul_fp(cpu->sample.core_pct_busy,
1066 cpu->pstate.scaling, cpu->sample.mperf); 1074 int_tofp(cpu->pstate.max_pstate_physical *
1075 cpu->pstate.scaling / 100)));
1067} 1076}
1068 1077
1069static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu) 1078static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu)
@@ -1106,8 +1115,6 @@ static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
1106 int32_t core_busy, max_pstate, current_pstate, sample_ratio; 1115 int32_t core_busy, max_pstate, current_pstate, sample_ratio;
1107 u64 duration_ns; 1116 u64 duration_ns;
1108 1117
1109 intel_pstate_calc_busy(cpu);
1110
1111 /* 1118 /*
1112 * core_busy is the ratio of actual performance to max 1119 * core_busy is the ratio of actual performance to max
1113 * max_pstate is the max non turbo pstate available 1120 * max_pstate is the max non turbo pstate available
@@ -1191,8 +1198,11 @@ static void intel_pstate_update_util(struct update_util_data *data, u64 time,
1191 if ((s64)delta_ns >= pid_params.sample_rate_ns) { 1198 if ((s64)delta_ns >= pid_params.sample_rate_ns) {
1192 bool sample_taken = intel_pstate_sample(cpu, time); 1199 bool sample_taken = intel_pstate_sample(cpu, time);
1193 1200
1194 if (sample_taken && !hwp_active) 1201 if (sample_taken) {
1195 intel_pstate_adjust_busy_pstate(cpu); 1202 intel_pstate_calc_busy(cpu);
1203 if (!hwp_active)
1204 intel_pstate_adjust_busy_pstate(cpu);
1205 }
1196 } 1206 }
1197} 1207}
1198 1208
@@ -1346,8 +1356,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
1346 out: 1356 out:
1347 intel_pstate_set_update_util_hook(policy->cpu); 1357 intel_pstate_set_update_util_hook(policy->cpu);
1348 1358
1349 if (hwp_active) 1359 intel_pstate_hwp_set_policy(policy);
1350 intel_pstate_hwp_set(policy->cpus);
1351 1360
1352 return 0; 1361 return 0;
1353} 1362}
@@ -1411,6 +1420,7 @@ static struct cpufreq_driver intel_pstate_driver = {
1411 .flags = CPUFREQ_CONST_LOOPS, 1420 .flags = CPUFREQ_CONST_LOOPS,
1412 .verify = intel_pstate_verify_policy, 1421 .verify = intel_pstate_verify_policy,
1413 .setpolicy = intel_pstate_set_policy, 1422 .setpolicy = intel_pstate_set_policy,
1423 .resume = intel_pstate_hwp_set_policy,
1414 .get = intel_pstate_get, 1424 .get = intel_pstate_get,
1415 .init = intel_pstate_cpu_init, 1425 .init = intel_pstate_cpu_init,
1416 .stop_cpu = intel_pstate_stop_cpu, 1426 .stop_cpu = intel_pstate_stop_cpu,