public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpupower: Do not change the frequency of offline cpu
@ 2015-07-22  8:20 Shilpasri G Bhat
  2015-07-22 11:44 ` Thomas Renninger
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shilpasri G Bhat @ 2015-07-22  8:20 UTC (permalink / raw)
  To: rafael.j.wysocki
  Cc: trenn, peter.senna, linux-pm, linux-kernel, ego, Shilpasri G Bhat

Check if the cpu is online before changing the frequency/governor of
the cpu.

Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
---
 tools/power/cpupower/utils/cpufreq-set.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c
index f656e58..4e21357 100644
--- a/tools/power/cpupower/utils/cpufreq-set.c
+++ b/tools/power/cpupower/utils/cpufreq-set.c
@@ -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) {
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-23 20:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22  8:20 [PATCH] cpupower: Do not change the frequency of offline cpu Shilpasri G Bhat
2015-07-22 11:44 ` Thomas Renninger
2015-07-23  5:12 ` Gautham R Shenoy
2015-07-23  6:50 ` [RESEND PATCH] " Shilpasri G Bhat
2015-07-23 20:58   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox