Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1999982ybe; Thu, 12 Sep 2019 02:57:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1FDebFLbfLr1rIPwxRdENWxJ2NE3wrdnFl1Lf7Eo9ihd4jQ0rit+MsC5YrpDSlswaBJWs X-Received: by 2002:a17:906:85c8:: with SMTP id i8mr33936120ejy.178.1568282253041; Thu, 12 Sep 2019 02:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568282253; cv=none; d=google.com; s=arc-20160816; b=Xk/qAo7+AYu/MU6NU5pO1yuSf0ulhn/mSoW/Kcg8yOnKUqipt6zVkKIUm+YtMhPTLA yaDS5xob/HPgEI56lEr0dN5ZV3FIPAX03JmVfxdD8pv8Sonfm/VSLyock3fSqnyl50CQ 8/BAC7S4dUoWSYsMpzZmA9ZfbA1GrALiatzQi61ZVFPMpdEywJfamrskqy5FQjMAF4zt 7xuztfdVPEwCG+7NFzlw3vT1ZxS8JQyefcPD9PhAFPW2F8pxmF6RPxcFAwGg8HWrpc6D UNSina/myw+t26zhsjE1U89TtwFEIYLY9/rC8WzoW+f3HNoVJm/aOiReseAye8UcVOLA DyyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AhSLHV2R1QiwIVbxUfeftzXlHZ5wVk8BvKPAyvBuNXc=; b=iqDmNK+gs0WImk5CMziR83GqdKChUnOllNMCrN2snqWWfM3uVo6zvLPjyl3H0omjTS qSLzYw0uvm2paYszB7lvDi3k7bro0KuTltFFKHdAGwAdlYOGWwGZ/RRCIbkATAJkDiFs EJSbqaDKSlDUvso3YGsm/ujg5hhz6q5MrQUQ+GOjtgD2wwq0YpZrPnnC3XYdBdwH10uZ 9HRh44hqlzI0qwKAe8yI054S997d1J5Lq7RdIAQl+KiZ6dLR4rJp3r7WrL2I6y11LpRd PxkbW4eg0VU6ImwO524yVG2ViM+MB54QZFgsQSTNGbEnlu8hQDD6h9rkMaZlPlaT1UyA KxzQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si13735691edx.233.2019.09.12.02.57.09; Thu, 12 Sep 2019 02:57:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730816AbfILJzU (ORCPT + 99 others); Thu, 12 Sep 2019 05:55:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:52420 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730428AbfILJzT (ORCPT ); Thu, 12 Sep 2019 05:55:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id D7EDCB67E; Thu, 12 Sep 2019 09:55:17 +0000 (UTC) From: Thomas Renninger To: Abhishek Goel Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, shuah@kernel.org, Thomas Renninger Subject: Re: [PATCH] cpupower : Handle set and info subcommands for powerpc Date: Thu, 12 Sep 2019 11:54:08 +0200 Message-ID: <12087195.kFesu4gPPu@skinner.arch.suse.de> In-Reply-To: <20190911095424.49605-1-huntbag@linux.vnet.ibm.com> References: <20190911095424.49605-1-huntbag@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Abishek, On Wednesday, September 11, 2019 11:54:24 AM CEST Abhishek Goel wrote: > Cpupower tool has set and info options which are not being used by > POWER machines. For powerpc, we will return directly for these two > subcommands. This removes the ambiguous error message while using set > option in case of power systems. > > Signed-off-by: Abhishek Goel > --- > tools/power/cpupower/utils/cpupower-info.c | 5 +++++ > tools/power/cpupower/utils/cpupower-set.c | 5 +++++ > 2 files changed, 10 insertions(+) > > diff --git a/tools/power/cpupower/utils/cpupower-info.c > b/tools/power/cpupower/utils/cpupower-info.c index > 4c9d342b70ff..674b707a76af 100644 > --- a/tools/power/cpupower/utils/cpupower-info.c > +++ b/tools/power/cpupower/utils/cpupower-info.c > @@ -39,6 +39,11 @@ int cmd_info(int argc, char **argv) > } params = {}; > int ret = 0; > > + #ifdef __powerpc__ > + printf(_("Cannot read info as system does not support performance bias > setting\n")); + return 0; > + #endif > + Please do no do this. cpupower info is designed to show general information related to powersaving features of your CPU. For examle there has been (see changelog): cpupower: Remove mc and smt power aware scheduler info/settings These kernel interfaces got removed by: Unfortunately only -b (perf bias on Intel only) is left right now. So if you cut this out for Power you do not see anything and the cmd is useless. Which is a pity, but for now makes sense. Ideally you provide some tag/option which makes sense on power (e.g. whether run in OPAL mode and if provide some figures otherwise tell running in VM mode). But if this is cut out something like this should do the same and is more flexible: - Still allows additional cpupower info features for other CPUs later easily - Should also cover AMD or other non-perf bias supporting CPUs to exclude perf_bias setting/info If this one works for you, can you please re-submit with also handling the set cmd similar. If it works or you only slightly adjust, feel free to already add: Acked-by: Thomas Renninger Thanks! Thomas --- tools/power/cpupower/utils/cpupower-info.c.orig 2019-09-12 11:45:02.578568335 +0200 +++ tools/power/cpupower/utils/cpupower-info.c 2019-09-12 11:46:09.618571947 +0200 @@ -55,8 +55,11 @@ } }; - if (!params.params) + if (!params.params) { params.params = 0x7; + if !(cpupower_cpu_info.caps & CPUPOWER_CAP_PERF_BIAS) + params.perf_bias = 0; + } /* Default is: show output of CPU 0 only */ if (bitmask_isallclear(cpus_chosen))