From: Rafael J. Wysocki Date: Mon, 25 Apr 2016 13:44:01 +0000 (+0200) Subject: Merge back cpufreq changes for v4.7. X-Git-Tag: v4.14-rc1~3056^2^2~29^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1cbc99dfe5d7d686fd022647f4e489b5eb8e9068;p=platform%2Fkernel%2Flinux-rpi.git Merge back cpufreq changes for v4.7. --- 1cbc99dfe5d7d686fd022647f4e489b5eb8e9068 diff --cc drivers/cpufreq/intel_pstate.c index 30fe323,1866705e..12ae2e6 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@@ -1127,13 -1127,8 +1127,12 @@@ static inline int32_t get_target_pstate */ duration_ns = cpu->sample.time - cpu->last_sample_time; if ((s64)duration_ns > pid_params.sample_rate_ns * 3) { - sample_ratio = div_fp(int_tofp(pid_params.sample_rate_ns), - int_tofp(duration_ns)); + sample_ratio = div_fp(pid_params.sample_rate_ns, duration_ns); core_busy = mul_fp(core_busy, sample_ratio); + } else { + sample_ratio = div_fp(100 * cpu->sample.mperf, cpu->sample.tsc); + if (sample_ratio < int_tofp(1)) + core_busy = 0; } cpu->sample.busy_scaled = core_busy;