Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964867AbbGVLpB (ORCPT ); Wed, 22 Jul 2015 07:45:01 -0400 Received: from cantor2.suse.de ([195.135.220.15]:40592 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933788AbbGVLo5 (ORCPT ); Wed, 22 Jul 2015 07:44:57 -0400 From: Thomas Renninger To: Shilpasri G Bhat Cc: rafael.j.wysocki@intel.com, peter.senna@gmail.com, ego@linux.vnet.ibm.com, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH] cpupower: Do not change the frequency of offline cpu Date: Wed, 22 Jul 2015 13:44:54 +0200 Message-ID: <5038391.4TLRDc8YB0@skinner> User-Agent: KMail/4.14.9 (Linux/3.16.7-21-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: <1437553249-25400-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> References: <1437553249-25400-1-git-send-email-shilpa.bhat@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1317 Lines: 40 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 > --- > 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 -- 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/