diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/cpufreq/cpufreq_interactive.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq_interactive.c b/drivers/cpufreq/cpufreq_interactive.c index 2e3d0f6a2eaf..e87942831186 100644 --- a/drivers/cpufreq/cpufreq_interactive.c +++ b/drivers/cpufreq/cpufreq_interactive.c @@ -65,6 +65,9 @@ static unsigned long go_maxspeed_load; /* Base of exponential raise to max speed; if 0 - jump to maximum */ static unsigned long boost_factor; +/* Max frequency boost in Hz; if 0 - no max is enforced */ +static unsigned long max_boost; + /* * Targeted sustainable load relatively to current frequency. * If 0, target is set realtively to the max speed @@ -114,6 +117,9 @@ static unsigned int cpufreq_interactive_get_target( return policy->max; target_freq = policy->cur * boost_factor; + + if (max_boost && target_freq > policy->cur + max_boost) + target_freq = policy->cur + max_boost; } else { if (!sustain_load) @@ -494,6 +500,22 @@ static ssize_t store_boost_factor(struct kobject *kobj, static struct global_attr boost_factor_attr = __ATTR(boost_factor, 0644, show_boost_factor, store_boost_factor); +static ssize_t show_max_boost(struct kobject *kobj, + struct attribute *attr, char *buf) +{ + return sprintf(buf, "%lu\n", max_boost); +} + +static ssize_t store_max_boost(struct kobject *kobj, + struct attribute *attr, const char *buf, size_t count) +{ + return strict_strtoul(buf, 0, &max_boost); +} + +static struct global_attr max_boost_attr = __ATTR(max_boost, 0644, + show_max_boost, store_max_boost); + + static ssize_t show_sustain_load(struct kobject *kobj, struct attribute *attr, char *buf) { @@ -556,6 +578,7 @@ static struct global_attr timer_rate_attr = __ATTR(timer_rate, 0644, static struct attribute *interactive_attributes[] = { &go_maxspeed_load_attr.attr, &boost_factor_attr.attr, + &max_boost_attr.attr, &sustain_load_attr.attr, &min_sample_time_attr.attr, &timer_rate_attr.attr, |