From: Shilpasri G Bhat Date: Thu, 23 Jul 2015 06:50:27 +0000 (+0530) Subject: cpupower: Do not change the frequency of offline cpu X-Git-Tag: v4.14-rc1~4788^2^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e5e8fd1ff9d802ab74df1ceaa5243da30491a45;p=platform%2Fkernel%2Flinux-rpi.git cpupower: Do not change the frequency of offline cpu Check if the cpu is online before changing the frequency/governor of the cpu. Reported-by: Pavaman Subramaniyam Signed-off-by: Shilpasri G Bhat Reviewed-by: Gautham R. Shenoy Acked-by: Thomas Renninger Signed-off-by: Rafael J. Wysocki --- diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c index f656e58..4e21357 100644 --- a/tools/power/cpupower/utils/cpufreq-set.c +++ b/tools/power/cpupower/utils/cpufreq-set.c @@ -17,6 +17,7 @@ #include "cpufreq.h" #include "helpers/helpers.h" +#include "helpers/sysfs.h" #define NORM_FREQ_LEN 32 @@ -318,6 +319,9 @@ int cmd_freq_set(int argc, char **argv) cpufreq_cpu_exists(cpu)) continue; + if (sysfs_is_cpu_online(cpu) != 1) + continue; + printf(_("Setting cpu: %d\n"), cpu); ret = do_one_cpu(cpu, &new_pol, freq, policychange); if (ret) {