소스 검색

Merge branch 'pm-cpufreq-fixes'

* pm-cpufreq-fixes:
  cpufreq: Abort cpufreq_update_current_freq() for cpufreq_suspended set
  intel_pstate: Avoid getting stuck in high P-states when idle
Rafael J. Wysocki 9 년 전
부모
커밋
395da1259a
2개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      drivers/cpufreq/cpufreq.c
  2. 4 0
      drivers/cpufreq/intel_pstate.c

+ 3 - 0
drivers/cpufreq/cpufreq.c

@@ -1491,6 +1491,9 @@ static unsigned int cpufreq_update_current_freq(struct cpufreq_policy *policy)
 {
 {
 	unsigned int new_freq;
 	unsigned int new_freq;
 
 
+	if (cpufreq_suspended)
+		return 0;
+
 	new_freq = cpufreq_driver->get(policy->cpu);
 	new_freq = cpufreq_driver->get(policy->cpu);
 	if (!new_freq)
 	if (!new_freq)
 		return 0;
 		return 0;

+ 4 - 0
drivers/cpufreq/intel_pstate.c

@@ -1130,6 +1130,10 @@ static inline int32_t get_target_pstate_use_performance(struct cpudata *cpu)
 		sample_ratio = div_fp(int_tofp(pid_params.sample_rate_ns),
 		sample_ratio = div_fp(int_tofp(pid_params.sample_rate_ns),
 				      int_tofp(duration_ns));
 				      int_tofp(duration_ns));
 		core_busy = mul_fp(core_busy, sample_ratio);
 		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;
 	cpu->sample.busy_scaled = core_busy;