Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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) {