Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp613404ybl; Fri, 10 Jan 2020 04:03:02 -0800 (PST) X-Google-Smtp-Source: APXvYqy7CAIiAmbk71ds6aCk66eR0sCk+nsRF/IQXtWDxYvMmNfss5G+5zlRg5PqFCqtZIAn4zcI X-Received: by 2002:aca:ec4f:: with SMTP id k76mr1805131oih.156.1578657782391; Fri, 10 Jan 2020 04:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578657782; cv=none; d=google.com; s=arc-20160816; b=jWPXbiAcVmlDCUCIH3GFNTUola09SmdqHBi26qC3Fr1gYQsqM7//WMiGFKJj70l2U2 akQJ2BEefp6jkU/L2KaiWxVDY6LtaqYJmXxLfbD6mAC5fgmdZAaDtw+uHtHluiAGG6O3 I6fTFV/53uCu2Yha7DenLjo3niRc7bjxdoRR/dzLSqikCYYW4IT5DjJwYI0BtLUviOsn Rm5/ZYyYQlmJwkH1tLEyzheeU4kYEJhfWL07WLcTrMyy0DXKH5X6fKBrw1Ova1MxSuK+ g105xyqIBqSuE43wBaPG4ANaaFbxVtoqfBJzz1yNisImddPb1iRHwHeQFo4b4LwNI/XB xYag== 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=2TP0KsSaVxT9ZTVrFQebcVrhvV8MB8eo58L5JcX0oyw=; b=XiThStvVB1ZC2b/Mew+ouyugFo4FcsCNaDb+9pxU1/DzkEoX7TWdaTj5SRtpZ9ECGI Ecchx1cFPiD3FFpjCvB2cTm2nPjOzVgtr3N9xxet76ajTMY24MkVtbzDaciUlgZ2s7MX FFRFPmzroaxntcsyjkItxaZIDaktskMtvdPN+6kL0fyeapjGTrqbZYso1FWwtuhqOygA XKrJynW8aK5Eneqpjx1rRBRB6lpmF0EAA6CNUuhTzhTyBnkCYryZmR3N4KttCKA5rr+B T4mcAnZaJ6fpwOH/UGDp4QmSLPdurtF3qudhQypVe4LSZIIZ4Agoi0h9IZ3J5Dp1wKCX i6ug== 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 c26si1187240otf.288.2020.01.10.04.02.49; Fri, 10 Jan 2020 04:03:02 -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 S1728004AbgAJMBb (ORCPT + 99 others); Fri, 10 Jan 2020 07:01:31 -0500 Received: from foss.arm.com ([217.140.110.172]:43508 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbgAJMBa (ORCPT ); Fri, 10 Jan 2020 07:01:30 -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 EF4B21063; Fri, 10 Jan 2020 04:01:27 -0800 (PST) Received: from [192.168.0.7] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6F8AB3F534; Fri, 10 Jan 2020 04:01:26 -0800 (PST) Subject: Re: [PATCH v1] arch_topology: Adjust initial CPU capacities with current freq To: Sudeep Holla , Jeffy Chen Cc: linux-kernel@vger.kernel.org, Brian Norris , Marc Zyngier , Douglas Anderson , Robin Murphy , Heiko Stuebner , Greg Kroah-Hartman , "Rafael J. Wysocki" References: <20200109075214.31943-1-jeffy.chen@rock-chips.com> <20200110113711.GB39451@bogus> From: Dietmar Eggemann Message-ID: <5475692c-e72b-74c1-bd6e-95278703249b@arm.com> Date: Fri, 10 Jan 2020 13:01:24 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200110113711.GB39451@bogus> 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 10/01/2020 12:37, Sudeep Holla wrote: > On Thu, Jan 09, 2020 at 03:52:14PM +0800, Jeffy Chen wrote: >> The CPU freqs are not supposed to change before cpufreq policies >> properly registered, meaning that they should be used to calculate the >> initial CPU capacities. >> >> Doing this helps choosing the best CPU during early boot, especially >> for the initramfs decompressing. >> >> Signed-off-by: Jeffy Chen > > [...] > >> @@ -146,10 +153,15 @@ bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu) >> return false; >> } >> } >> - capacity_scale = max(cpu_capacity, capacity_scale); >> raw_capacity[cpu] = cpu_capacity; >> pr_debug("cpu_capacity: %pOF cpu_capacity=%u (raw)\n", >> cpu_node, raw_capacity[cpu]); >> + >> + cpu_clk = of_clk_get(cpu_node, 0); >> + if (!PTR_ERR_OR_ZERO(cpu_clk)) >> + per_cpu(max_freq, cpu) = clk_get_rate(cpu_clk) / 1000; >> + >> + clk_put(cpu_clk); > > I don't like to assume DVFS to be supplied only using 'clk'. So NACK! > We have other non-clk mechanism for CPU DVFS and this needs to simply > use cpufreq APIs to get frequency value if required. To support this, it's failing on my Arm64 Juno board. ... [ 0.084858] CPU1 cpu_clk=-517 [ 0.087961] CPU2 cpu_clk=-517 [ 0.091005] CPU0 cpu_clk=-517 [ 0.094121] CPU3 cpu_clk=-517 [ 0.097248] CPU4 cpu_clk=-517 [ 0.100415] CPU5 cpu_clk=-517 ... Since you're on a big.LITTLE platform, did you specify 'capacity-dmips-mhz' for CPUs to be able to distinguish big and little CPUs before CPUfreq kicks in? $ grep capacity-dmips-mhz ./arch/arm64/boot/dts/arm/juno.dts capacity-dmips-mhz = <1024>; capacity-dmips-mhz = <1024>; capacity-dmips-mhz = <578>; capacity-dmips-mhz = <578>; capacity-dmips-mhz = <578>; capacity-dmips-mhz = <578>;