From: Rafael J. Wysocki Date: Fri, 6 May 2016 20:01:14 +0000 (+0200) Subject: Merge cpufreq fixes going into v4.6. X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=da43af961b50f1b6367660c0dba0b5fd205c4217;p=deliverable%2Flinux.git Merge cpufreq fixes going into v4.6. * pm-cpufreq-fixes: intel_pstate: Fix intel_pstate_get() cpufreq: intel_pstate: Fix HWP on boot CPU after system resume cpufreq: st: enable selective initialization based on the platform cpufreq: intel_pstate: Fix processing for turbo activation ratio --- da43af961b50f1b6367660c0dba0b5fd205c4217 diff --cc drivers/cpufreq/intel_pstate.c index 74453fe546c1,b230ebaae66c..3addb22725e1 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@@ -1188,16 -1070,11 +1201,17 @@@ static inline bool intel_pstate_sample( static inline int32_t get_avg_frequency(struct cpudata *cpu) { - return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf * - cpu->pstate.scaling, cpu->sample.mperf); + return fp_toint(mul_fp(cpu->sample.core_pct_busy, + int_tofp(cpu->pstate.max_pstate_physical * + cpu->pstate.scaling / 100))); } +static inline int32_t get_avg_pstate(struct cpudata *cpu) +{ + return div64_u64(cpu->pstate.max_pstate_physical * cpu->sample.aperf, + cpu->sample.mperf); +} + static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu) { struct sample *sample = &cpu->sample; @@@ -1558,9 -1420,9 +1572,10 @@@ static struct cpufreq_driver intel_psta .flags = CPUFREQ_CONST_LOOPS, .verify = intel_pstate_verify_policy, .setpolicy = intel_pstate_set_policy, + .resume = intel_pstate_hwp_set_policy, .get = intel_pstate_get, .init = intel_pstate_cpu_init, + .exit = intel_pstate_cpu_exit, .stop_cpu = intel_pstate_stop_cpu, .name = "intel_pstate", };