aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-27 16:01:35 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-06-27 16:01:35 -0400
commit874e628f8b34cf4b3b7f471063841647c221f453 (patch)
tree3bcca932475369dc501686e07f7e51fe092a9840 /drivers/cpufreq
parentf4fd3797848aa04e72e942c855fd279840a47fe4 (diff)
parentc28375583b6471c1cb833a628ab6afb5b69079d0 (diff)
Merge branch 'pm-fixes' into pm-cpufreq
A subsequent commit depends on the 'pm-fixes' commits.
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/cpufreq_ondemand.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index 4b9bb5def6f1..93eb5cbcc1f6 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -47,6 +47,8 @@ static struct od_ops od_ops;
47static struct cpufreq_governor cpufreq_gov_ondemand; 47static struct cpufreq_governor cpufreq_gov_ondemand;
48#endif 48#endif
49 49
50static unsigned int default_powersave_bias;
51
50static void ondemand_powersave_bias_init_cpu(int cpu) 52static void ondemand_powersave_bias_init_cpu(int cpu)
51{ 53{
52 struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu); 54 struct od_cpu_dbs_info_s *dbs_info = &per_cpu(od_cpu_dbs_info, cpu);
@@ -543,7 +545,7 @@ static int od_init(struct dbs_data *dbs_data)
543 545
544 tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR; 546 tuners->sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR;
545 tuners->ignore_nice = 0; 547 tuners->ignore_nice = 0;
546 tuners->powersave_bias = 0; 548 tuners->powersave_bias = default_powersave_bias;
547 tuners->io_is_busy = should_io_be_busy(); 549 tuners->io_is_busy = should_io_be_busy();
548 550
549 dbs_data->tuners = tuners; 551 dbs_data->tuners = tuners;
@@ -585,6 +587,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias)
585 unsigned int cpu; 587 unsigned int cpu;
586 cpumask_t done; 588 cpumask_t done;
587 589
590 default_powersave_bias = powersave_bias;
588 cpumask_clear(&done); 591 cpumask_clear(&done);
589 592
590 get_online_cpus(); 593 get_online_cpus();
@@ -593,11 +596,17 @@ static void od_set_powersave_bias(unsigned int powersave_bias)
593 continue; 596 continue;
594 597
595 policy = per_cpu(od_cpu_dbs_info, cpu).cdbs.cur_policy; 598 policy = per_cpu(od_cpu_dbs_info, cpu).cdbs.cur_policy;
596 dbs_data = policy->governor_data; 599 if (!policy)
597 od_tuners = dbs_data->tuners; 600 continue;
598 od_tuners->powersave_bias = powersave_bias;
599 601
600 cpumask_or(&done, &done, policy->cpus); 602 cpumask_or(&done, &done, policy->cpus);
603
604 if (policy->governor != &cpufreq_gov_ondemand)
605 continue;
606
607 dbs_data = policy->governor_data;
608 od_tuners = dbs_data->tuners;
609 od_tuners->powersave_bias = default_powersave_bias;
601 } 610 }
602 put_online_cpus(); 611 put_online_cpus();
603} 612}