@@ -47,6 +47,8 @@ static struct od_ops od_ops;
47
47
static struct cpufreq_governor cpufreq_gov_ondemand ;
48
48
#endif
49
49
50
+ static unsigned int default_powersave_bias ;
51
+
50
52
static void ondemand_powersave_bias_init_cpu (int cpu )
51
53
{
52
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
546
tuners -> sampling_down_factor = DEF_SAMPLING_DOWN_FACTOR ;
545
547
tuners -> ignore_nice = 0 ;
546
- tuners -> powersave_bias = 0 ;
548
+ tuners -> powersave_bias = default_powersave_bias ;
547
549
tuners -> io_is_busy = should_io_be_busy ();
548
550
549
551
dbs_data -> tuners = tuners ;
@@ -585,6 +587,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias)
585
587
unsigned int cpu ;
586
588
cpumask_t done ;
587
589
590
+ default_powersave_bias = powersave_bias ;
588
591
cpumask_clear (& done );
589
592
590
593
get_online_cpus ();
@@ -593,11 +596,17 @@ static void od_set_powersave_bias(unsigned int powersave_bias)
593
596
continue ;
594
597
595
598
policy = per_cpu (od_cpu_dbs_info , cpu ).cdbs .cur_policy ;
596
- dbs_data = policy -> governor_data ;
597
- od_tuners = dbs_data -> tuners ;
598
- od_tuners -> powersave_bias = powersave_bias ;
599
+ if (!policy )
600
+ continue ;
599
601
600
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
611
put_online_cpus ();
603
612
}
0 commit comments