Merge back earlier cpufreq material.
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 3 Jun 2014 13:03:27 +0000 (15:03 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 3 Jun 2014 13:03:27 +0000 (15:03 +0200)
Conflicts:
arch/mips/loongson/lemote-2f/clock.c
drivers/cpufreq/intel_pstate.c

1  2 
MAINTAINERS
drivers/cpufreq/intel_pstate.c

diff --cc MAINTAINERS
Simple merge
@@@ -557,20 -539,25 +551,20 @@@ static void intel_pstate_get_cpu_pstate
  
        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,
-                                       struct sample *sample)
+ static inline void intel_pstate_calc_busy(struct cpudata *cpu)
  {
 -      int32_t core_pct;
 -      int32_t c0_pct;
+       struct sample *sample = &cpu->sample;
 +      int64_t core_pct;
 +      int32_t rem;
  
 -      core_pct = div_fp(int_tofp(sample->aperf), int_tofp(sample->mperf));
 -      core_pct = mul_fp(core_pct, int_tofp(100));
 -      FP_ROUNDUP(core_pct);
 +      core_pct = int_tofp(sample->aperf) * int_tofp(100);
 +      core_pct = div_u64_rem(core_pct, int_tofp(sample->mperf), &rem);
  
 -      c0_pct = div_fp(int_tofp(sample->mperf), int_tofp(sample->tsc));
 +      if ((rem << 1) >= int_tofp(sample->mperf))
 +              core_pct += 1;
  
        sample->freq = fp_toint(
                mul_fp(int_tofp(cpu->pstate.max_pstate * 1000), core_pct));
@@@ -587,15 -575,17 +581,15 @@@ static inline void intel_pstate_sample(
  
        aperf = aperf >> FRAC_BITS;
        mperf = mperf >> FRAC_BITS;
 -      tsc = tsc >> FRAC_BITS;
  
 +      cpu->last_sample_time = cpu->sample.time;
 +      cpu->sample.time = ktime_get();
        cpu->sample.aperf = aperf;
        cpu->sample.mperf = mperf;
 -      cpu->sample.tsc = tsc;
        cpu->sample.aperf -= cpu->prev_aperf;
        cpu->sample.mperf -= cpu->prev_mperf;
 -      cpu->sample.tsc -= cpu->prev_tsc;
  
-       intel_pstate_calc_busy(cpu, &cpu->sample);
+       intel_pstate_calc_busy(cpu);
  
        cpu->prev_aperf = aperf;
        cpu->prev_mperf = mperf;