Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1990072ybe; Thu, 12 Sep 2019 02:46:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4yGoe59nod/ipSMEgPFFKwK8btj4UqrlMq1huLYPJstEtWdBSQ+XVMtTI2U5VxmP71o6P X-Received: by 2002:aa7:d2c1:: with SMTP id k1mr40924005edr.245.1568281569023; Thu, 12 Sep 2019 02:46:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568281569; cv=none; d=google.com; s=arc-20160816; b=cMxRXpTv+ikNW9QpTzKIeY315hFziGZUY9t/DI7RKQv8jP6EKFKDF7nVWbVPPNCmj1 ikazhdq8Pr3i1x/d5PdoSf7EhVOaCmhuSZFvR3cSRPx03zLcX2x5tZ1t8sDlSWait0Se Uyc5xD/Eioy2yeYG3Z1gmpglNBXm6lPzXUELlqWRHLmRjhpyAcrw28D0kkdjgab+F0+q vyxr/pgSPVUwzrcTXB7uWsoeeJczx691oocr6Ao3/7gfLmIqIDO9Cxuuw64JyJgYsKPj BFMO95wyucfX+OHuYUyEOYdSsweBrCN+1gEkXfkrcEZn+nX6bymjQStnGyu4CSX23a+t WRAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject; bh=rX3EGwd4R0Ve6wg5jCIuaeAGmZCLUycuTX3ICnvRAgk=; b=ECwnYDNE/echfuOmz4DFIsNpiGRFVss151pD6HbhEpT6SCF6DsblNq8/x5szGnY46O gJi1sztvgYsWOdsnwjGf3j6q6JhJU4YZWU+MYu2PIFsWu07yyKkQHyczUenuqcHIZhv0 rcYaQqLHyvnfmdbekygMPMLYC5VMvlAK6L3j9ni+wsgcbrsGChTiZoS0am0gGP9c8TM/ pVUD1mHryEDlJ3+wR4QvsA09tXWNtfUZoIru/aioBPAhmzEvpVyz9bxqzufOMgAD3NiX mILcRK91nt7gCOtNzH0mcQ9WxAL9WLIAXl9PLvXCJzty8oqs/PuGXwI/l/YB9jcWztuc gIqg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si13107935edl.192.2019.09.12.02.45.44; Thu, 12 Sep 2019 02:46:09 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730742AbfILJn5 (ORCPT + 99 others); Thu, 12 Sep 2019 05:43:57 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58676 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730337AbfILJn5 (ORCPT ); Thu, 12 Sep 2019 05:43:57 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8C9htqU089594 for ; Thu, 12 Sep 2019 05:43:55 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2uyhj84rak-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 12 Sep 2019 05:43:55 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Sep 2019 10:43:47 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 12 Sep 2019 10:43:43 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8C9hgVL50725114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 12 Sep 2019 09:43:42 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 52F4D4C04A; Thu, 12 Sep 2019 09:43:42 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 49FF54C046; Thu, 12 Sep 2019 09:43:41 +0000 (GMT) Received: from oc0383214508.ibm.com (unknown [9.124.35.231]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 12 Sep 2019 09:43:41 +0000 (GMT) Subject: Re: [PATCH] cpupower : Handle set and info subcommands for powerpc To: shuah , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: trenn@suse.com, "Gautham R. Shenoy" References: <20190911095424.49605-1-huntbag@linux.vnet.ibm.com> <3326dc53-f8a1-dd7b-5ae8-b86ef5ef8b24@kernel.org> From: Abhishek Date: Thu, 12 Sep 2019 15:13:40 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <3326dc53-f8a1-dd7b-5ae8-b86ef5ef8b24@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 19091209-0020-0000-0000-0000036B5D12 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091209-0021-0000-0000-000021C0EDF9 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-12_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1909120102 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Shuah, Thanks for the review. Few comments below. On 09/11/2019 03:41 PM, shuah wrote: > On 9/11/19 3:54 AM, 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. > > What is the error message you see? Please include it in the commit log. > Sure. Will include it in next version. >> >> 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 >> + > We see something like this for "cpupower info" ---> "System does not support Intel's performance bias setting" > I am not in favor of bailing out this early with this ifdef switch. > I would rather see this checked somehow(?) when the ambiguous error > happens. Since these two options are not being used by any other architecture except x86, I suggest these options should not even be shown for other architecture. So we can do something like this in cpupower.c : static struct cmd_struct commands[] = {          ............. +#if defined (__x86_64__) || defined (__i386__)         { "set",        cmd_set,        1    },         { "info",        cmd_info,        0    }, +#endif         .............. Is this Okay? > >>       setlocale(LC_ALL, ""); >>       textdomain(PACKAGE); >>   diff --git a/tools/power/cpupower/utils/cpupower-set.c >> b/tools/power/cpupower/utils/cpupower-set.c >> index 3cd95c6cb974..c95b29278780 100644 >> --- a/tools/power/cpupower/utils/cpupower-set.c >> +++ b/tools/power/cpupower/utils/cpupower-set.c >> @@ -41,6 +41,11 @@ int cmd_set(int argc, char **argv) >>       int perf_bias = 0; >>       int ret = 0; >>   +    #ifdef __powerpc__ >> +    printf(_("System does not support performance bias setting\n")); >> +    return 0; >> +    #endif >> + > > Same here. > For "cpupower set -b 10", we get something like : "Error setting perf-bias value on CPU" >>       setlocale(LC_ALL, ""); >>       textdomain(PACKAGE); >> > > thanks, > -- Shuah Thanks, -- Abhishek