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

* Re: [PATCH] cpupower: Do not change the frequency of offline cpu
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Thomas Renninger @ 2015-07-22 11:44 UTC (permalink / raw)
  To: Shilpasri G Bhat
  Cc: rafael.j.wysocki, peter.senna, ego, linux-kernel, linux-pm

On Wednesday, July 22, 2015 01:50:49 PM Shilpasri G Bhat wrote:
> 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) {

Thanks for catching this one and sending a patch!

Acked-by: Thomas Renninger <trenn@suse.com>

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

* Re: [PATCH] cpupower: Do not change the frequency of offline cpu
  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
  2 siblings, 0 replies; 5+ messages in thread
From: Gautham R Shenoy @ 2015-07-23  5:12 UTC (permalink / raw)
  To: Shilpasri G Bhat
  Cc: rafael.j.wysocki, trenn, peter.senna, linux-pm, linux-kernel, ego

Hi Shilpa,

This looks good. 

Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>

On Wed, Jul 22, 2015 at 01:50:49PM +0530, Shilpasri G Bhat wrote:
> 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	[flat|nested] 5+ messages in thread

* [RESEND PATCH] cpupower: Do not change the frequency of offline cpu
  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 ` Shilpasri G Bhat
  2015-07-23 20:58   ` Rafael J. Wysocki
  2 siblings, 1 reply; 5+ messages in thread
From: Shilpasri G Bhat @ 2015-07-23  6:50 UTC (permalink / raw)
  To: rafael.j.wysocki; +Cc: trenn, ego, linux-pm, linux-kernel, Shilpasri G Bhat

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

Reported-by: Pavaman Subramaniyam <pavsubra@linux.vnet.ibm.com>
Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
Acked-by: Thomas Renninger <trenn@suse.com>
---

Included Reported-by tag

 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

* Re: [RESEND PATCH] cpupower: Do not change the frequency of offline cpu
  2015-07-23  6:50 ` [RESEND PATCH] " Shilpasri G Bhat
@ 2015-07-23 20:58   ` Rafael J. Wysocki
  0 siblings, 0 replies; 5+ messages in thread
From: Rafael J. Wysocki @ 2015-07-23 20:58 UTC (permalink / raw)
  To: Shilpasri G Bhat; +Cc: rafael.j.wysocki, trenn, ego, linux-pm, linux-kernel

On Thursday, July 23, 2015 12:20:27 PM Shilpasri G Bhat wrote:
> Check if the cpu is online before changing the frequency/governor of
> the cpu.
> 
> Reported-by: Pavaman Subramaniyam <pavsubra@linux.vnet.ibm.com>
> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
> Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
> Acked-by: Thomas Renninger <trenn@suse.com>

Queued up for 4.3, thanks!

Rafael


^ permalink raw reply	[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