Skip to content

Commit 22782b3

Browse files
committed
cpuidle: governor: Add new governors to cpuidle_governors again
After commit 61cb575 ("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: 61cb575 ("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>
1 parent 814b879 commit 22782b3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/cpuidle/governor.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ int cpuidle_register_governor(struct cpuidle_governor *gov)
8989
mutex_lock(&cpuidle_lock);
9090
if (__cpuidle_find_governor(gov->name) == NULL) {
9191
ret = 0;
92+
list_add_tail(&gov->governor_list, &cpuidle_governors);
9293
if (!cpuidle_curr_governor ||
9394
!strncasecmp(param_governor, gov->name, CPUIDLE_NAME_LEN) ||
9495
(cpuidle_curr_governor->rating < gov->rating &&

0 commit comments

Comments
 (0)