summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-03-12 19:13:13 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-23 20:11:35 +0100
commitb41991d86722d6557ca9e4509313d894c9fdc46b (patch)
treefb428df3e33b258c7f49bf1825bff1ae97b9d9fd
parent6eea03f8c368b79f8b8ca0fbe4cbe23ce51cb843 (diff)
downloadtalos-obmc-linux-b41991d86722d6557ca9e4509313d894c9fdc46b.tar.gz
talos-obmc-linux-b41991d86722d6557ca9e4509313d894c9fdc46b.zip
cpuidle: governor: Add new governors to cpuidle_governors again
commit 22782b3f9bb8ae21c710e2880db21bc729771e92 upstream. After commit 61cb5758d3c4 ("cpuidle: Add cpuidle.governor= command line parameter") new cpuidle governors are not added to the list of available governors, so governor selection via sysfs doesn't work as expected (even though it is rarely used anyway). Fix that by making cpuidle_register_governor() add new governors to cpuidle_governors again. Fixes: 61cb5758d3c4 ("cpuidle: Add cpuidle.governor= command line parameter") Reported-by: Kees Cook <keescook@chromium.org> Cc: 5.0+ <stable@vger.kernel.org> # 5.0+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/cpuidle/governor.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
index bb93e5cf6a4a..9fddf828a76f 100644
--- a/drivers/cpuidle/governor.c
+++ b/drivers/cpuidle/governor.c
@@ -89,6 +89,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
mutex_lock(&cpuidle_lock);
if (__cpuidle_find_governor(gov->name) == NULL) {
ret = 0;
+ list_add_tail(&gov->governor_list, &cpuidle_governors);
if (!cpuidle_curr_governor ||
!strncasecmp(param_governor, gov->name, CPUIDLE_NAME_LEN) ||
(cpuidle_curr_governor->rating < gov->rating &&
OpenPOWER on IntegriCloud