]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cpufreq: Fix GOV_LIMITS handling for the userspace governor
authorSai Gurrappadi <sgurrappadi@nvidia.com>
Fri, 29 Apr 2016 21:44:37 +0000 (14:44 -0700)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 Sep 2016 09:14:17 +0000 (11:14 +0200)
commit5fd55fb3dd4e854aa89d744774ea77c4468b4272
treec2979334b53a5a2beada0b25064e3d87c7b9599c
parentb0c04f74642bc9c8179a294ef33ee12a5748c919
cpufreq: Fix GOV_LIMITS handling for the userspace governor

commit e43e94c1eda76dabd686ddf6f7825f54d747b310 upstream.

Currently, the userspace governor only updates frequency on GOV_LIMITS
if policy->cur falls outside policy->{min/max}. However, it is also
necessary to update current frequency on GOV_LIMITS to match the user
requested value if it can be achieved within the new policy->{max/min}.

This was previously the behaviour in the governor until commit d1922f0
("cpufreq: Simplify userspace governor") which incorrectly assumed that
policy->cur == user requested frequency via scaling_setspeed. This won't
be true if the user requested frequency falls outside policy->{min/max}.
Ex: a temporary thermal cap throttled the user requested frequency.

Fix this by storing the user requested frequency in a seperate variable.
The governor will then try to achieve this request on every GOV_LIMITS
change.

Fixes: d1922f02562f (cpufreq: Simplify userspace governor)
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/cpufreq/cpufreq_userspace.c