]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: conservative: Fix next frequency selection
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 12 Oct 2016 19:47:03 +0000 (21:47 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 13 Oct 2016 12:42:06 +0000 (14:42 +0200)
commit01f778b9eb2b24b270291df82869e5e66f7346f6
treec346d3f1add775bacbec9e0dc51f8f3e88ecfec7
parent3e08b897ba162e04def20187d0cb1ce6c67cad6c
cpufreq: conservative: Fix next frequency selection

Commit d47f3c674f09 (cpufreq: conservative: Do not use transition
notifications) overlooked the case when the "frequency step" used
by the conservative governor is small relative to the distances
between the available frequencies and broke the algorithm by
using policy->cur instead of the previously requested frequency
when computing the next one.

As a result, the governor may not be able to go outside of a narrow
range between two consecutive available frequencies.

Fix the problem by making the governor save the previously requested
frequency and select the next one relative that value (unless it is
out of range, in which case policy->cur will be used instead).

Fixes: d47f3c674f09 (cpufreq: conservative: Do not use transition notifications)
Link: https://bugzilla.kernel.org/show_bug.cgi?id=177171
Reported-and-tested-by: Aleksey Rybalkin <aleksey@rybalkin.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 4.8+ <stable@vger.kernel.org> # 4.8+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_conservative.c