Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp942877pxb; Thu, 9 Sep 2021 15:57:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqlxbTI3cyH5Ig8zsxEe8sva49wsYdGJU6+H0I0W3pnzMdBxczTObTCHrSNDQ1jOvSXDg2 X-Received: by 2002:a17:906:7047:: with SMTP id r7mr5793408ejj.342.1631228243571; Thu, 09 Sep 2021 15:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631228243; cv=none; d=google.com; s=arc-20160816; b=OsYkYc6wuQzglgB+GNYOJHluhmqpW8eN08YgnQc+lmvdy9XVkK18WzKu2ZbEVoUzcV tWxY2psVY6qt8ADYTrPAtwvWWdW3Ahs5KWGKO6zXWDZL4IwRkoA4Cwqd9TRsiusKk3LQ Wtb72vAd10TP6kWNJAo6pq9bVmI6ZSjkMIuW6fvrIJ2DNy827oIvFsD/Ls87O5AyFKbb PysjQwEAJd3DEkU0cZcfyXwm+VPXzJjDSrhf1TPU+nRBMnkGE3/kTURc2TW3S/H1sA1m /n//CO3xVnyu+paBkkfYY3FEmtt/4s+BQJFv3yOyXrI2W5MlFGYsp0JUQULBFeRKUVFG LrDw== 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=jfvcWwOBIgI08h7a65dIdk6UKcUBFS1A3sjkWIlsagM=; b=V5m1BeRpO8w3/wDHmZxwyPOw8vU0tV92wV7iwu7RTZwNOxIBvMC8LjAkePi1FI7SxS FF2J0IO+Mm5ZZ8wVU8DAjGtOm226MbEGF0ol91sZQCpY2WOTc6WotWA36qLJCOwmFxLR NRdi7cXt12GT8vKqfT9PJP7GOST7/50ldRoX0bNVc37zSCw3zvQoTFeue9l3bll7aFd2 22kttEu8SF65/zEtS3LzMAa12GlIQ4IsRiwLWVj7+7ISKBD0dQhrJ0fjisvi1EKHZprq 7rANa0fhRfUywfXrq3U7vLiRKfiiPKwOFxSmNeLpQl0sTMF2JIsnPfnDXTynfaxK7Nti ZW5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=Ku66LCIm; 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 d16si3243653ejm.114.2021.09.09.15.56.48; Thu, 09 Sep 2021 15:57:23 -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=Ku66LCIm; 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 S234805AbhIIWq6 (ORCPT + 99 others); Thu, 9 Sep 2021 18:46:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240862AbhIIWq5 (ORCPT ); Thu, 9 Sep 2021 18:46:57 -0400 Received: from mail-il1-x12a.google.com (mail-il1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE4BC061574 for ; Thu, 9 Sep 2021 15:45:47 -0700 (PDT) Received: by mail-il1-x12a.google.com with SMTP id z2so41153iln.0 for ; Thu, 09 Sep 2021 15:45:47 -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=jfvcWwOBIgI08h7a65dIdk6UKcUBFS1A3sjkWIlsagM=; b=Ku66LCImX7qsAGEUk6Xe+jFK47ojLK5DzbF68gIS1zCTatEbRBPJE9yFP41xL3dZfd uRdIkGGUhxbyfxAEFzJZroJgjQJ3jEsiV99iCvzOyMVBJU5RwohZfdsGt4IDiCBOIEm+ leWxcR4HmPE9BMbKfzrB98jsLvBaE6HZYjM08= 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=jfvcWwOBIgI08h7a65dIdk6UKcUBFS1A3sjkWIlsagM=; b=L8vy/BjGOi/VzAA2k7ipKzJMoa7zbi88JncNbFeOefSw6WeC4LlfCw09POV8qaEi58 blUedujwDUA/mNJXtI4bNX1jblITFLtDOMfUGGvll0USkFlIM3Q+56rmj9PYZcuoOKlK l4ocV8gZVUYlZzpvHJKPqMe+sjyp3Zvuz82cg8ZHHGziAZDBkvp27jbssBWnDtAJBG8s OyQidahXnx3yBZngxtbV7f2Cv2hIJXr/uIgKQ9JBc97mLfNps6p1W/uKTZXtSyPpabZ9 W90oupAW28EUTv2bHQpmTC3ZENA7iGVqpBAQj/IEz/os0dYeCmUGjdwcwoTjAPLAplq0 3pdA== X-Gm-Message-State: AOAM532q/LvGrN+4Q94gUb5Eel9Kzg9vOwFb2W8FIPC8LYbbMlfoDFdM Y8/Wf+TK9UenLzt9Hvc1sw5jbA== X-Received: by 2002:a92:b742:: with SMTP id c2mr508841ilm.141.1631227547039; Thu, 09 Sep 2021 15:45:47 -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 g19sm50483ilb.84.2021.09.09.15.45.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 09 Sep 2021 15:45:46 -0700 (PDT) Subject: Re: [PATCH 17/19] cpupower: add amd-pstate get data function to query the info 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-18-ray.huang@amd.com> From: Shuah Khan Message-ID: <318fb963-9334-a735-ca60-3eb180618141@linuxfoundation.org> Date: Thu, 9 Sep 2021 16:45:45 -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-18-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 8:59 AM, Huang Rui wrote: > Frequency-info needs an interface to query the current amd-pstate data. > Let's add more information here. > Signed-off-by: Huang Rui > --- > tools/power/cpupower/lib/cpufreq.c | 6 ++++++ > tools/power/cpupower/lib/cpufreq.h | 13 +++++++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/tools/power/cpupower/lib/cpufreq.c b/tools/power/cpupower/lib/cpufreq.c > index 37da87bdcfb1..1443080868da 100644 > --- a/tools/power/cpupower/lib/cpufreq.c > +++ b/tools/power/cpupower/lib/cpufreq.c > @@ -810,3 +810,9 @@ int amd_pstate_boost_enabled(unsigned int cpu) > > return cpuinfo_max == amd_pstate_max ? 1 : 0; > } > + > +unsigned amd_pstate_get_data(unsigned int cpu, enum amd_pstate_param param) > +{ > + return sysfs_cpufreq_get_one_value(cpu, > + param + AMD_PSTATE_HIGHEST_PERF); > +} > diff --git a/tools/power/cpupower/lib/cpufreq.h b/tools/power/cpupower/lib/cpufreq.h > index d54d02a7a4f4..954e72704fc0 100644 > --- a/tools/power/cpupower/lib/cpufreq.h > +++ b/tools/power/cpupower/lib/cpufreq.h > @@ -206,6 +206,19 @@ int cpufreq_set_frequency(unsigned int cpu, > int amd_pstate_boost_support(unsigned int cpu); > int amd_pstate_boost_enabled(unsigned int cpu); > > +enum amd_pstate_param { > + HIGHEST_PERF, > + NOMINAL_PERF, > + LOWEST_NONLINEAR_PERF, > + LOWEST_PERF, > + MAX_FREQ, > + NOMINAL_FREQ, > + LOWEST_NONLINEAR_FREQ, > + MIN_FREQ, > +}; > + > +unsigned amd_pstate_get_data(unsigned int cpu, enum amd_pstate_param param); > + > #ifdef __cplusplus > } > #endif > amd specific things added to common files? I would like to see this patch series redone to follow the existing common vs. vendor specific separation. thanks, -- Shuah