Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp466839ybv; Thu, 13 Feb 2020 04:00:35 -0800 (PST) X-Google-Smtp-Source: APXvYqzPzySR3qHJ4eSiNGPl6Zgg0M2BuFQxV0jwe97OBqu6TRDMXFA1LJnFg8aXlDiNtbFH1KWo X-Received: by 2002:aca:4c90:: with SMTP id z138mr2682419oia.140.1581595235769; Thu, 13 Feb 2020 04:00:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581595235; cv=none; d=google.com; s=arc-20160816; b=vsA/urorcSFWGHdkJ6bueNMfBw88+VsAcjtHT4msZPQ8prjGbdTmfheelSqQ6145K7 CADQkdbKzCv/c+FwEyvCFJGjrJ5iYjNxRUklLOks3fJf8xI4hGkgPKqkWFEyhGtieers py7jCsf6tfRPQ4LJZBT/El/C+VbNeqxc2pVMmRvqT6t/VvS8VAP/YSrCqfl+ZcOvjOCx ipJnOGui86ED+bSAerWNHq6MUasybnpbY2W9GeNK3hWKtMikELj5zF+/B80zbrEwONA1 o/H4WRGu5bcwmVGbjy3j8mgrpQgFZWbVjskY4BbtjGwczq3ThvOm9+9F8vm7FKFaKXrT VHzA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=4SHnWo4kuWv2/wK8OByCtCrJIRchpQg846OGMbcfWew=; b=xBtlwp/NOjfddRQElyQxHWW0/WjaHfCoThVLdCpg8QoE78w2H1Y+K4FIL8ADT2Tmu+ wa+RlyogTWeFkKc7yB6rCU7UCSCJaGsa6HTJ9ZI3vIVlMyDowPhTgDCtY0LSoJZ3YD+w 4kfmX1Yvtqyziu4b5DSR0CtHb1lbVPR9lufFVGG9WjmkWEwvDJbptJAYApUjUljivnQM P3B/TuF36LKv0xiAPhiax7upQT/TZ45nHkgs5rO0rZpsPP4LhSYSb41klL7afY+6w9Br iS5GGLG/kqewTFO9B2veUbI8UjS5f0cUPT82VyldnKGJcMxeh4K+9OOuN8wZYGwtB8T1 mWHQ== 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 b18si964908otp.17.2020.02.13.04.00.22; Thu, 13 Feb 2020 04:00:35 -0800 (PST) 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 S1729940AbgBMMAE (ORCPT + 99 others); Thu, 13 Feb 2020 07:00:04 -0500 Received: from foss.arm.com ([217.140.110.172]:45610 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729531AbgBMMAD (ORCPT ); Thu, 13 Feb 2020 07:00:03 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EB8D61FB; Thu, 13 Feb 2020 04:00:02 -0800 (PST) Received: from [10.1.195.59] (ifrit.cambridge.arm.com [10.1.195.59]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E1AA03F6CF; Thu, 13 Feb 2020 04:00:00 -0800 (PST) Subject: Re: [PATCH v3 5/7] cpufreq: add function to get the hardware max frequency To: Ionela Voinescu , catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, maz@kernel.org, suzuki.poulose@arm.com, sudeep.holla@arm.com, lukasz.luba@arm.com, rjw@rjwysocki.net Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, viresh.kumar@linaro.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org References: <20200211184542.29585-1-ionela.voinescu@arm.com> <20200211184542.29585-6-ionela.voinescu@arm.com> From: Valentin Schneider Message-ID: Date: Thu, 13 Feb 2020 11:59:56 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200211184542.29585-6-ionela.voinescu@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/11/20 6:45 PM, Ionela Voinescu wrote: > +/** > + * cpufreq_get_hw_max_freq - get the max hardware frequency of the CPU > + * @cpu: CPU number > + * > + * The default return value is the max_freq field of cpuinfo. > + */ > +__weak unsigned int cpufreq_get_hw_max_freq(unsigned int cpu) > +{ > + struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); > + unsigned int ret_freq = 0; > + > + if (policy) { > + ret_freq = policy->cpuinfo.max_freq; > + cpufreq_cpu_put(policy); What about intel_pstate / turbo stuff? IIRC one of Giovanni's issues was that turbo freq is not always reported as the max freq. Dunno if we can do anything about it; at the very least maybe document the caveat? > + } > + > + return ret_freq; > +} > +EXPORT_SYMBOL(cpufreq_get_hw_max_freq); > + > static unsigned int __cpufreq_get(struct cpufreq_policy *policy) > { > if (unlikely(policy_is_inactive(policy)))