public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@linux.vnet.ibm.com>
To: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Cc: rafael.j.wysocki@intel.com, trenn@suse.com,
	peter.senna@gmail.com, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, ego@linux.vnet.ibm.com
Subject: Re: [PATCH] cpupower: Do not change the frequency of offline cpu
Date: Thu, 23 Jul 2015 10:42:59 +0530	[thread overview]
Message-ID: <20150723051259.GB25364@in.ibm.com> (raw)
In-Reply-To: <1437553249-25400-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com>

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
> 


  parent reply	other threads:[~2015-07-23  5:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=20150723051259.GB25364@in.ibm.com \
    --to=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=shilpa.bhat@linux.vnet.ibm.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