summaryrefslogtreecommitdiff
path: root/tools/power/cpupower/utils/cpupower-set.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-01-26 18:28:36 +0300
committerPaolo Bonzini <pbonzini@redhat.com>2016-01-26 18:28:36 +0300
commitb8bc3bde9c8c90500c648627d53f846642ff8639 (patch)
tree0c3ed82848a25948206556bc699a10d30bd18d07 /tools/power/cpupower/utils/cpupower-set.c
parent171b5682aa8597174e80ec4128c87538103f2213 (diff)
parent9abc2a08a7d665b02bdde974fd6c44aae86e923e (diff)
downloadlinux-b8bc3bde9c8c90500c648627d53f846642ff8639.tar.xz
Merge tag 'kvm-s390-master-4.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD
KVM: s390: Fixes for kvm/master (targeting 4.5) 1. Fallout of some bigger floating point/vector rework in s390 - memory leak -> stable 4.3+ - memory overwrite -> stable 4.4+ 2. enable KVM-VFIO for s390
Diffstat (limited to 'tools/power/cpupower/utils/cpupower-set.c')
-rw-r--r--tools/power/cpupower/utils/cpupower-set.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/power/cpupower/utils/cpupower-set.c b/tools/power/cpupower/utils/cpupower-set.c
index 3e6f374f8dd7..532f46b9a335 100644
--- a/tools/power/cpupower/utils/cpupower-set.c
+++ b/tools/power/cpupower/utils/cpupower-set.c
@@ -12,7 +12,6 @@
#include <string.h>
#include <getopt.h>
-#include <cpufreq.h>
#include "helpers/helpers.h"
#include "helpers/sysfs.h"
#include "helpers/bitmask.h"
@@ -78,10 +77,15 @@ int cmd_set(int argc, char **argv)
for (cpu = bitmask_first(cpus_chosen);
cpu <= bitmask_last(cpus_chosen); cpu++) {
- if (!bitmask_isbitset(cpus_chosen, cpu) ||
- cpufreq_cpu_exists(cpu))
+ if (!bitmask_isbitset(cpus_chosen, cpu))
continue;
+ if (sysfs_is_cpu_online(cpu) != 1){
+ fprintf(stderr, _("Cannot set values on CPU %d:"), cpu);
+ fprintf(stderr, _(" *is offline\n"));
+ continue;
+ }
+
if (params.perf_bias) {
ret = msr_intel_set_perf_bias(cpu, perf_bias);
if (ret) {