Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6248115ybi; Wed, 29 May 2019 05:14:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqy0hnO8E9+Bok2Fri3RaGMoURyTX9yb5Qgsj2hXBBCwD1KNy5zoYDgWs3XfTLoSCCk0ygux X-Received: by 2002:a62:4c5:: with SMTP id 188mr89152604pfe.19.1559132075856; Wed, 29 May 2019 05:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559132075; cv=none; d=google.com; s=arc-20160816; b=X9TrszZimSWcGofa5/ncwA3V0GDMNCq1TmYs9fLc4ksCD7mAlctiLqkPmbKXRwaqn6 s/z6g2E6cGm7mr+DVQTOFsvtBm48yQbLauaiwV+Y5F2zjkjfC/lDFj5yoc8+Q3ntqAsO XC5UyDf+f7F3KvLqmhu6TUl12W6lJYasZEfYVYgYKibZJgD7xLWs7Qv9lp3JRpSeOCyC tZtnC6R84TPuQ/tH8vkYo7FonzfU+ubawAZgJZN27Ix+kiibcgiqpX1KAqJKZRlfBF1t laAYMXluhDbrf3LSXhVIXyxnRo/3PcHrahH3Cov4PnvneBBu3mAWTdPx/BaG4jNWOPKF etpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=XjaYpK8Rsg46AR4Gtit0a5QnhHGfewPp+tzF3TFTKK8=; b=IvB93B6gWJ5GXeHLkcS/W6offfmp+f+tXkffMY/xV2sgA5RAUzJFRjsQVuD5qeHf79 lvCUkZmzVwBeNCJJO9gEpdHwqyX06EkO+ryGcdSCRTgOLBAdOK7GR6EXE9Lr7qih2J99 6ukv/DxICvqK5W1P0gbu1RB8xAuWAOUVrJpM/dEQ3zkVqNnoRoQiPLMkIGmP4AXAMb5E nZnh1U1QuYzDa6ccu33nrjyZPiK6tXENl1jPSFn/xGUjSwzfgDLBYD+6u51OC6CwPAih NsEnJr+D+2gswv/p19KJhRwhgwna/eMbzTP5UTP2W2ikcz1hbHTO4bV7xpuzNdIAyvAT Ucxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QfqcTP93; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b38si6854096pgb.250.2019.05.29.05.14.17; Wed, 29 May 2019 05:14:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QfqcTP93; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726863AbfE2MMr (ORCPT + 99 others); Wed, 29 May 2019 08:12:47 -0400 Received: from mail-ot1-f68.google.com ([209.85.210.68]:35862 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726808AbfE2MMq (ORCPT ); Wed, 29 May 2019 08:12:46 -0400 Received: by mail-ot1-f68.google.com with SMTP id c3so1770931otr.3; Wed, 29 May 2019 05:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=XjaYpK8Rsg46AR4Gtit0a5QnhHGfewPp+tzF3TFTKK8=; b=QfqcTP932tiOW4eCsLKgIS8SbhVqWpXSL0xLNpCWHkbyrnxW1VIuaXO7JRGGnSRBZF VWfI5dSN9JLGRyd8XBVr45CiSp99xIq1Kvo4jNN5R3eMyMcmNMbhLOR99gvb0eXYaX/+ oA9KW0c1EM5p45jO/GNHMmmXnE6UZEUHOoIHrZztceSudZpwS9NGmoMkPE0UV5Bl8LUh KjyDQDxGYiom02p/1gZ1nA6qlgILkOSvSNK5VJ9ZX6phqvDpVtMIfS15BWMedFsahMHi Pz1ArK7I6XMPD4Soslb4KE640iZ/7/CxLt0Rf2UcdfZarBjuHEZhng8EMG4blY5QfKTI B3SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=XjaYpK8Rsg46AR4Gtit0a5QnhHGfewPp+tzF3TFTKK8=; b=QTVtSN28yKKmYpN7TN3/RnOgDWnhO6BrpAPkl8W+nlFC0T4QbWeFb5pUGnH6R8l6mA oQLZm0q3fj70f4XpeXoNs0Go+JDa3JOnXiDuZwcNOeFk5r1AwbZWdcq9nDKb5Dk/6/fQ czVw2lJ+5lIRF9wE9dso6+hlYEsDy2+PPJ7loKAbmu7FjhtIFfBRXdzX+9MFTKjUnGl1 nTlOQL1rduMCHDpsa72SFRzzGGiTozRlgB9JmrcnBV/2ZOBqTqx9/SSF9lP7tsAZluAL BHyXx0ZJSvwpokZRcCbEedMg7l/kK6okTJZOZg5n5UPlhy06Evme6I+vmzbENWSB0a7W eXEQ== X-Gm-Message-State: APjAAAVmuRisOgwve+B16e9jG8F9r0YgEeD214pecS/j6A9XFpoBgaus UebMhRpxoeu27Znjl9vjYkhEUQBVP57ZQYeFRUM= X-Received: by 2002:a9d:470d:: with SMTP id a13mr54132otf.162.1559131965416; Wed, 29 May 2019 05:12:45 -0700 (PDT) MIME-Version: 1.0 References: <20190529093033.30068-1-huntbag@linux.vnet.ibm.com> In-Reply-To: <20190529093033.30068-1-huntbag@linux.vnet.ibm.com> Reply-To: ego@linux.vnet.ibm.com From: Gautham R Shenoy Date: Wed, 29 May 2019 17:42:34 +0530 Message-ID: Subject: Re: [PATCH] cpupower : frequency-set -r option misses the last cpu in related cpu list To: Abhishek Goel Cc: trenn@suse.com, shuah@kernel.org, Linux PM list , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Abhishek, On Wed, May 29, 2019 at 3:02 PM Abhishek Goel wrote: > > To set frequency on specific cpus using cpupower, following syntax can > be used : > cpupower -c #i frequency-set -f #f -r > > While setting frequency using cpupower frequency-set command, if we use > '-r' option, it is expected to set frequency for all cpus related to > cpu #i. But it is observed to be missing the last cpu in related cpu > list. This patch fixes the problem. > > Signed-off-by: Abhishek Goel > --- > tools/power/cpupower/utils/cpufreq-set.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tools/power/cpupower/utils/cpufreq-set.c b/tools/power/cpupower/utils/cpufreq-set.c > index 1eef0aed6..08a405593 100644 > --- a/tools/power/cpupower/utils/cpufreq-set.c > +++ b/tools/power/cpupower/utils/cpufreq-set.c > @@ -306,6 +306,8 @@ int cmd_freq_set(int argc, char **argv) > bitmask_setbit(cpus_chosen, cpus->cpu); > cpus = cpus->next; > } > + /* Set the last cpu in related cpus list */ > + bitmask_setbit(cpus_chosen, cpus->cpu); Perhaps you could convert the while() loop to a do .. while(). That should will ensure that we terminate the loop after setting the last valid CPU. > cpufreq_put_related_cpus(cpus); > } > } > -- > 2.17.1 > -- Thanks and Regards gautham.