Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbbGWFOD (ORCPT ); Thu, 23 Jul 2015 01:14:03 -0400 Received: from e32.co.us.ibm.com ([32.97.110.150]:45700 "EHLO e32.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750702AbbGWFNy (ORCPT ); Thu, 23 Jul 2015 01:13:54 -0400 X-Helo: d03dlp01.boulder.ibm.com X-MailFrom: ego@linux.vnet.ibm.com X-RcptTo: linux-pm@vger.kernel.org Date: Thu, 23 Jul 2015 10:42:59 +0530 From: Gautham R Shenoy To: Shilpasri G Bhat 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 Message-ID: <20150723051259.GB25364@in.ibm.com> Reply-To: ego@linux.vnet.ibm.com References: <1437553249-25400-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1437553249-25400-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15072305-0005-0000-0000-000015D4B9B1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1329 Lines: 46 Hi Shilpa, This looks good. Reviewed-by: Gautham R. Shenoy 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 > --- > 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 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/