Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp941766pxb; Thu, 9 Sep 2021 15:55:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO3nOa208UcrJRMa4jeqPZxa1SXzFJxk+hPZEGLBxsxjh2x7g7KQ7DB8GXDzHhEgJcdnOx X-Received: by 2002:a92:d646:: with SMTP id x6mr4088386ilp.280.1631228115874; Thu, 09 Sep 2021 15:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631228115; cv=none; d=google.com; s=arc-20160816; b=FuTft94/gQU5RfBqf2KdRNNqvUf+YCsGJBLFufOAOhm8EPJYJkVhYeQ+FF4wAlTbZC 3cEIIBgRQkWR6XbxUaQLWMFDVQ+hvqxev2u/Zxd5IZTmytST0Uhh0vaLj/7kBu6Fmsr/ lfGCtv5BSjDUTT1/ZzfA//EfBUdPICkjjx9hBnv4a8/eJCxTJmIf53cufx2wVzXhwzX/ T6jZVZNpLZkKZF7WpHyDODyoxF6qzD7J1ggQD4NySXTLtRjuyD5Je4QPBn5jb3iT+X/T JfRMe9eL8v1tJeyLv6ta9YfMCLPYCT252ppx2WA82W7KxnuguepAy9mHakvz643bqssc sT0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=plbVGyQIOThzcyQI2bqq3xPq+wHbHcvpVyb7goK7gHc=; b=ZrCQU+kDe/8Xyqg8WRhjatM9nvFSWmIvr6WeT/MLuh7ALwpLu++JKk/9P43hlIGAg2 Gli0EGqlB3F2EFVbGWtRaskB2q5Wc7XTuf4SHqw0oiAFSHO7ee4ZJm5Q2AmQLTAA49NK hWFueXK3Osg2poge0xE0Gch8ejvketZM/WZur4cq6r8VLFuasCtNQuT3G7RLCcwaJPWk HaBT2RhoE7nb+h5nX+qhSP4Wb3ahg8/ywcQTCTO7nIbzuGrzAoGoE8NNBrgD74gj8HBt iNMM/v5fDjl6HCdyLDmqq6L8DFMidgs0bkjF9RtHUNJrctbgsSHx46cMjvx2MI1N8RV8 WzTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=fhd4DCBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si3851950ios.94.2021.09.09.15.55.03; Thu, 09 Sep 2021 15:55:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=fhd4DCBz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343850AbhIIWrw (ORCPT + 99 others); Thu, 9 Sep 2021 18:47:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240862AbhIIWrv (ORCPT ); Thu, 9 Sep 2021 18:47:51 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE23C061574 for ; Thu, 9 Sep 2021 15:46:41 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id q3so4462223iot.3 for ; Thu, 09 Sep 2021 15:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=plbVGyQIOThzcyQI2bqq3xPq+wHbHcvpVyb7goK7gHc=; b=fhd4DCBzKorNNb3b4gS2EF2xw/MOHFayRSModD8JqUdvSOildhuQJuK6zX6nQ2h4E2 zk1v1N33njT97+FbdqnGmZjoFf84XZ6flA7R/XRID6A+0tT9d2kqLN6679D/gJv0MQzS MHRa8UtzY3HNvn7FLhewwI673tVtg+jQmeIkg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=plbVGyQIOThzcyQI2bqq3xPq+wHbHcvpVyb7goK7gHc=; b=lpN+1vDsWVLs+rUg3Hw5E8gqbpxTinIAJYmyQPwn4uQNclihOxthksoFyjGYyYxFio Aeqlih3mHtBLb7+1KVh287DeH0Vczh04moFxrCavTijqwZ+6wqkyp3ip/DIlYZQrBdAb BUmmFe2jMwMxs7OlLu8nx08dANEcdS6osnzN1p/b5YuP1ywVjlc2Z+HUWTGRicbu4DQt G/5EP3FbkvPtM1eDP2HvW6PRiqqku8GjSOYQyrgmv7L7tBFEG24XO59VLtHMKcVrEtQu Ke4KohdTSVEzuLTNRSh8qn52xojzCozUBp5PqYtZZTPDtlezUdEVnCQesEgdtg9AfHz7 ijVg== X-Gm-Message-State: AOAM531ysdDSM6EzaUtQoY6omqi1n41T1qpUecr8YXNDO4Q302HKDmde nyxGkMfJgY1r57LIiyHzPrccAg== X-Received: by 2002:a6b:28b:: with SMTP id 133mr4590855ioc.107.1631227600907; Thu, 09 Sep 2021 15:46:40 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id c11sm1568248ioh.50.2021.09.09.15.46.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 15:46:40 -0700 (PDT) Subject: Re: [PATCH 18/19] cpupower: print amd-pstate information on cpupower To: Huang Rui , "Rafael J . Wysocki" , Viresh Kumar , Borislav Petkov , Ingo Molnar , linux-pm@vger.kernel.org Cc: Deepak Sharma , Alex Deucher , Mario Limonciello , Nathan Fontenot , Jinzhou Su , Xiaojian Du , linux-kernel@vger.kernel.org, x86@kernel.org, Shuah Khan References: <20210908150001.3702552-1-ray.huang@amd.com> <20210908150001.3702552-19-ray.huang@amd.com> From: Shuah Khan Message-ID: <70bef125-398b-8a3c-07f5-a4ebc68dc0c8@linuxfoundation.org> Date: Thu, 9 Sep 2021 16:46:39 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210908150001.3702552-19-ray.huang@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/8/21 9:00 AM, Huang Rui wrote: > amd-pstate kernel module is using the fine grain frequency instead of > acpi hardware pstate. So the performance and frequency values should be > printed in frequency-info. > > Signed-off-by: Huang Rui > --- > tools/power/cpupower/utils/cpufreq-info.c | 27 ++++++++++++++++++++--- > 1 file changed, 24 insertions(+), 3 deletions(-) > > diff --git a/tools/power/cpupower/utils/cpufreq-info.c b/tools/power/cpupower/utils/cpufreq-info.c > index f9895e31ff5a..9eabed209adc 100644 > --- a/tools/power/cpupower/utils/cpufreq-info.c > +++ b/tools/power/cpupower/utils/cpufreq-info.c > @@ -183,9 +183,30 @@ static int get_boost_mode_x86(unsigned int cpu) > printf(_(" Supported: %s\n"), support ? _("yes") : _("no")); > printf(_(" Active: %s\n"), active ? _("yes") : _("no")); > > - if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD && > - cpupower_cpu_info.family >= 0x10) || > - cpupower_cpu_info.vendor == X86_VENDOR_HYGON) { > + if (cpupower_cpu_info.vendor == X86_VENDOR_AMD && > + cpupower_cpu_info.caps & CPUPOWER_CAP_AMD_PSTATE) { > + printf(_(" AMD PSTATE Highest Performance: %u. Maximum Frequency: "), > + amd_pstate_get_data(cpu, HIGHEST_PERF)); > + print_speed(amd_pstate_get_data(cpu, MAX_FREQ)); > + printf(".\n"); > + > + printf(_(" AMD PSTATE Nominal Performance: %u. Nominal Frequency: "), > + amd_pstate_get_data(cpu, NOMINAL_PERF)); > + print_speed(amd_pstate_get_data(cpu, NOMINAL_FREQ)); > + printf(".\n"); > + > + printf(_(" AMD PSTATE Lowest Non-linear Performance: %u. Lowest Non-linear Frequency: "), > + amd_pstate_get_data(cpu, LOWEST_NONLINEAR_PERF)); > + print_speed(amd_pstate_get_data(cpu, LOWEST_NONLINEAR_FREQ)); > + printf(".\n"); > + > + printf(_(" AMD PSTATE Lowest Performance: %u. Lowest Frequency: "), > + amd_pstate_get_data(cpu, LOWEST_PERF)); > + print_speed(amd_pstate_get_data(cpu, MIN_FREQ)); > + printf(".\n"); > + } else if ((cpupower_cpu_info.vendor == X86_VENDOR_AMD && > + cpupower_cpu_info.family >= 0x10) || > + cpupower_cpu_info.vendor == X86_VENDOR_HYGON) { > ret = decode_pstates(cpu, b_states, pstates, &pstate_no); > if (ret) > return ret; > Same issue here - amd specific code sprinkled all over the common routines. Needs fixing. thanks, -- Shuah