doug@s15:~/temp-k-git-3.10rc4/linux/drivers/cpufreq$ diff -u intel_pstate.c.315rc5.dirk3 intel_pstate.c.315rc5.dirk4 --- intel_pstate.c.315rc5.dirk3 2014-05-22 08:09:49.307336907 -0700 +++ intel_pstate.c.315rc5.dirk4 2014-05-24 14:56:35.670640514 -0700 @@ -98,6 +98,7 @@ struct vid_data vid; struct _pid pid; + int active_flag; ktime_t last_sample_time; u64 prev_aperf; u64 prev_mperf; @@ -627,7 +628,7 @@ if (duration_us > sample_time * 10) { sample_ratio = div_fp(int_tofp(sample_time), int_tofp(duration_us)); - core_busy = mul_fp(core_busy, sample_ratio); +// core_busy = mul_fp(core_busy, sample_ratio); } return core_busy; @@ -658,23 +659,34 @@ struct cpudata *cpu = (struct cpudata *) __data; struct sample *sample; - u32 pstate_save = cpu->pstate.current_pstate; + u32 pstate_save; - intel_pstate_sample(cpu); - sample = &cpu->sample; + if( cpu->active_flag != 0){ // check for overrun + pr_info("Intel pstate: Catastrophic Error: Overrun: cpu %d\n", cpu->cpu); + } else { + cpu->active_flag = 1; + + pstate_save = cpu->pstate.current_pstate; + + intel_pstate_sample(cpu); - intel_pstate_adjust_busy_pstate(cpu); + sample = &cpu->sample; - trace_pstate_sample(fp_toint(sample->core_pct_busy), - fp_toint(intel_pstate_get_scaled_busy(cpu)), - pstate_save, - cpu->pstate.current_pstate, - sample->mperf, - sample->aperf, - sample->freq); + intel_pstate_adjust_busy_pstate(cpu); - intel_pstate_set_sample_time(cpu); + trace_pstate_sample(fp_toint(sample->core_pct_busy), + fp_toint(intel_pstate_get_scaled_busy(cpu)), + pstate_save, + cpu->pstate.current_pstate, + sample->mperf, + sample->aperf, + sample->freq); + + intel_pstate_set_sample_time(cpu); + + cpu->active_flag = 0; + } /* endif */ } #define ICPU(model, policy) \ @@ -730,6 +742,8 @@ pr_info("Intel pstate controlling: cpu %d\n", cpunum); + cpu->active_flag = 0; + return 0; }