From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED2C2C433E0 for ; Tue, 12 Jan 2021 03:26:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B1E7E22D6E for ; Tue, 12 Jan 2021 03:26:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726860AbhALD0Y (ORCPT ); Mon, 11 Jan 2021 22:26:24 -0500 Received: from mga01.intel.com ([192.55.52.88]:10196 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725885AbhALD0X (ORCPT ); Mon, 11 Jan 2021 22:26:23 -0500 IronPort-SDR: D90M404xAA2QrWBunVTaMky0fezNkvhUAUJCFv4GNlaFKm6VDiXd6rkDaa8LXPZLivUZVw6LLF FDuLSMiOy/Xw== X-IronPort-AV: E=McAfee;i="6000,8403,9861"; a="196592119" X-IronPort-AV: E=Sophos;i="5.79,340,1602572400"; d="scan'208";a="196592119" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2021 19:25:42 -0800 IronPort-SDR: 3s1r7R1yZdsCv6iY1gJjdsJ7OI+cHHI9ESWWeIfl8QBrVeSC2sFW7fTmE8bsRHfTQH8Ctz9v+C LC4nnNviKf3A== X-IronPort-AV: E=Sophos;i="5.79,340,1602572400"; d="scan'208";a="571573980" Received: from chenyu-office.sh.intel.com ([10.239.158.173]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2021 19:25:40 -0800 Date: Tue, 12 Jan 2021 11:29:02 +0800 From: Chen Yu To: "Rafael J. Wysocki" Cc: Srinivas Pandruvada , Len Brown , "Rafael J. Wysocki" , Viresh Kumar , Linux PM , Linux Kernel Mailing List , Zhang Rui , Wendy Wang Subject: Re: [PATCH 1/2][v2] cpufreq: intel_pstate: Add parameter to get guarantee frequency Message-ID: <20210112032902.GB28619@chenyu-office.sh.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 11, 2021 at 01:44:09PM +0100, Rafael J. Wysocki wrote: > On Mon, Jan 11, 2021 at 8:40 AM Chen Yu wrote: > > > > Add input parameter to receive guarantee pstate from intel_pstate_get_hwp_max() > > for later use. > > I'm not a fan of this change, because the new argument will only be > needed in one place where intel_pstate_get_hwp_max() and it requires > adding redundant local vars and pointless updates elsewhere. > > Besides, in intel_pstate_get_cpu_pstates() you can do something like > this after calling intel_pstate_get_hwp_max(): > > cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(READ_ONCE(cpu->hwp_cap_cached)); > cpu->pstate.max_freq = cpu->pstate.max_pstate * cpu->pstate.scaling; Okay, will do in next version. Thanks, Chenyu