From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752659AbcBHM2q (ORCPT ); Mon, 8 Feb 2016 07:28:46 -0500 Received: from foss.arm.com ([217.140.101.70]:60301 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbcBHM2o (ORCPT ); Mon, 8 Feb 2016 07:28:44 -0500 Subject: Re: [PATCH v3 4/6] arm64: Enable dynamic CPU capacity initialization To: Juri Lelli , linux-kernel@vger.kernel.org References: <1454500799-18451-1-git-send-email-juri.lelli@arm.com> <1454500799-18451-5-git-send-email-juri.lelli@arm.com> Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, peterz@infradead.org, vincent.guittot@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, linux@arm.linux.org.uk, sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, morten.rasmussen@arm.com, broonie@kernel.org From: Dietmar Eggemann Message-ID: <56B889F7.306@arm.com> Date: Mon, 8 Feb 2016 12:28:39 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454500799-18451-5-git-send-email-juri.lelli@arm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/02/16 11:59, Juri Lelli wrote: > Define arch_wants_init_cpu_capacity() to return true; so that > cpufreq_init_cpu_capacity() can go ahead and profile CPU capacities > at boot time. [...] > > +bool arch_wants_init_cpu_capacity(void) > +{ > + return true; Isn't this a little bit too simple? Not every ARM/ARM64 platform is a heterogeneous one. You could add code to compare the cpu node 'compatible' properties (required) and only return true if they differ, which would let you detect uarch based heterogeneity. In case of max. frequency based heterogeneity (clusters consisting of same cpu types but running at different max. frequency), you're at the mercy of cpu node 'clock-frequency' properties (optional). We might argue that for these platforms, providing cpu node 'clock-frequency' properties is necessary. The 'struct cpu_efficiency table_efficiency[]' based approach in ARM already faces this problem. > +} > + > static int __init get_cpu_for_node(struct device_node *node) > { > struct device_node *cpu_node; >