Skip to content

Commit

Permalink
tools/power/x86/intel-speed-select: Special handling for CPU 0 online…
Browse files Browse the repository at this point in the history
…/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 <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
  • Loading branch information
spandruvada authored and andy-shev committed Mar 20, 2020
1 parent 6320c9f commit 6966919
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/power/x86/intel-speed-select/isst-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6966919

Please sign in to comment.