aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2012-10-24 16:16:34 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-14 18:33:07 -0500
commit8636fd280e970696be62c8495a5aacb5f3b6237d (patch)
tree654bc5707fde353a8fdbdf6121d4c54cadd51440 /drivers
parentdb7011516cbfc3d867b77721f77258d36cfbf705 (diff)
cpufreq: fix jiffies/cputime mixup in conservative/ondemand governors
The function get_cpu_idle_time_jiffy in both the conservative and ondemand governors use jiffies_to_usecs to convert a cputime value to usecs which gives the wrong value on architectures where cputime and jiffies use different units. Only matters if NO_HZ is disabled, since otherwise get_cpu_idle_time_us should already return a valid value, and get_cpu_idle_time_jiffy isn't actually called. Signed-off-by: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/cpufreq_governor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq_governor.c b/drivers/cpufreq/cpufreq_governor.c
index 0001071cdcdb..679842a8d34a 100644
--- a/drivers/cpufreq/cpufreq_governor.c
+++ b/drivers/cpufreq/cpufreq_governor.c
@@ -33,9 +33,9 @@ static inline u64 get_cpu_idle_time_jiffy(unsigned int cpu, u64 *wall)
33 33
34 idle_time = cur_wall_time - busy_time; 34 idle_time = cur_wall_time - busy_time;
35 if (wall) 35 if (wall)
36 *wall = jiffies_to_usecs(cur_wall_time); 36 *wall = cputime_to_usecs(cur_wall_time);
37 37
38 return jiffies_to_usecs(idle_time); 38 return cputime_to_usecs(idle_time);
39} 39}
40 40
41cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall) 41cputime64_t get_cpu_idle_time(unsigned int cpu, cputime64_t *wall)