From: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
To: rafael.j.wysocki@intel.com
Cc: trenn@suse.com, peter.senna@gmail.com, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, ego@linux.vnet.ibm.com,
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Subject: [PATCH] cpupower: Do not change the frequency of offline cpu
Date: Wed, 22 Jul 2015 13:50:49 +0530 [thread overview]
Message-ID: <1437553249-25400-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> (raw)
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
next reply other threads:[~2015-07-22 8:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-22 8:20 Shilpasri G Bhat [this message]
2015-07-22 11:44 ` [PATCH] cpupower: Do not change the frequency of offline cpu 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1437553249-25400-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com \
--to=shilpa.bhat@linux.vnet.ibm.com \
--cc=ego@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peter.senna@gmail.com \
--cc=rafael.j.wysocki@intel.com \
--cc=trenn@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox