]> git.baikalelectronics.ru Git - kernel.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)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 4 May 2016 23:30:38 +0000 (01:30 +0200)
commite3212906be55c214caa93cc30f3064832606407b
tree9668779f7f97f3fbd76e3e9a9876be69bfc74fe8
parente7be4a702f8deca6b0aab0c586766722b63515b8
cpufreq: Fix GOV_LIMITS handling for the userspace governor

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 aaec827
("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: aaec827061b7 (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>
drivers/cpufreq/cpufreq_userspace.c