From a87527a595929066ece90afee858c24818a6981a Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 4 Dec 2007 11:54:22 +0000 Subject: [PATCH] [cpufreq] Correctly calculate load The idle time of the system should be less than the wall time of the system. The initial implementation incorrectly set idle time to wall time when idle time was less than wall time, instead of when idle time was more than wall time. Correct this error. Signed-off-by: Mark Langsdorf --- drivers/cpufreq/cpufreq_ondemand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 466ebe9b..a790f051 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c @@ -319,7 +319,7 @@ static int dbs_calc_load(struct cpu_dbs_info_s *this_dbs_info) tmp_idle_msecs = tmp_idle_nsecs; if (tmp_wall_msecs == 0) tmp_wall_msecs = 1; - if (tmp_idle_msecs < tmp_wall_msecs) + if (tmp_idle_msecs > tmp_wall_msecs) tmp_idle_msecs = tmp_wall_msecs; tmp_load = (100 * (tmp_wall_msecs - tmp_idle_msecs)) / -- 2.39.5