Commit 2e5e8fd1 authored by Shilpasri G Bhat's avatar Shilpasri G Bhat Committed by Rafael J. Wysocki

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: default avatarPavaman Subramaniyam <pavsubra@linux.vnet.ibm.com>
Signed-off-by: default avatarShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Reviewed-by: default avatarGautham R. Shenoy <ego@linux.vnet.ibm.com>
Acked-by: default avatarThomas Renninger <trenn@suse.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 52721d9d
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment