aboutsummaryrefslogtreecommitdiff
path: root/drivers/cpufreq/cpufreq_ondemand.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpufreq/cpufreq_ondemand.c')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index bd069349bca..2ab3c12b88a 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -640,8 +640,11 @@ static int __init cpufreq_gov_dbs_init(void)
{
int err;
cputime64_t wall;
- u64 idle_time = get_cpu_idle_time_us(smp_processor_id(), &wall);
+ u64 idle_time;
+ int cpu = get_cpu();
+ idle_time = get_cpu_idle_time_us(cpu, &wall);
+ put_cpu();
if (idle_time != -1ULL) {
/* Idle micro accounting is supported. Use finer thresholds */
dbs_tuners_ins.up_threshold = MICRO_FREQUENCY_UP_THRESHOLD;