diff options
author | Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> | 2020-03-05 14:45:16 -0800 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2020-03-20 14:46:20 +0200 |
commit | 696691985c3191f2c4c76f09b1c7c5f3ca99d5ed (patch) | |
tree | 054cc8cd34f801b4036a948c441da4d250b8f9a4 | |
parent | 6320c9fb91212bc951b3a2d2cc2fceb1de4aea43 (diff) |
tools/power/x86/intel-speed-select: Special handling for CPU 0 online/offline
When "-o" option for force online/offline is used with command:
perf-profile set-config-level
If the config level calls for CPU 0 online/offline, then call fails
as there is special kernel setup required for CPU 0 online/offline
and the currently not setup for that.
But when call is for online CPU 0, then don't fail. Just warn that
this system is not setup for CPU 0 online/offline.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r-- | tools/power/x86/intel-speed-select/isst-config.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/power/x86/intel-speed-select/isst-config.c b/tools/power/x86/intel-speed-select/isst-config.c index 405b03cba248..b8f4846d7c78 100644 --- a/tools/power/x86/intel-speed-select/isst-config.c +++ b/tools/power/x86/intel-speed-select/isst-config.c @@ -220,8 +220,14 @@ static void set_cpu_online_offline(int cpu, int state) "/sys/devices/system/cpu/cpu%d/online", cpu); fd = open(buffer, O_WRONLY); - if (fd < 0) + if (fd < 0) { + if (!cpu && state) { + fprintf(stderr, "This system is not configured for CPU 0 online/offline\n"); + fprintf(stderr, "Ignoring online request for CPU 0 as this is already online\n"); + return; + } err(-1, "%s open failed", buffer); + } if (state) ret = write(fd, "1\n", 2); |