Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp590230ybl; Fri, 10 Jan 2020 03:38:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyb1kGWokflx01g4yLuf/iPYPMR8+CY4yJ8xjNnNEaR9SAXkVRwsLRJDW+WJWjZR4BlmHju X-Received: by 2002:a05:6830:10d5:: with SMTP id z21mr2323946oto.30.1578656304478; Fri, 10 Jan 2020 03:38:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578656304; cv=none; d=google.com; s=arc-20160816; b=lgHWhRVfn4TfjdW/9MPXOFS/Oe3nugE3/MayWlUDfNlFC99PM1L9ZYH504VazN5AmE vdLmFWSLZH6BBkJ228MIW9ai22BXCQb2vhiWmbicyaSPrNO1vavb7RD61X4vdlNNnvEV w9Xvz3ePP6uRHJDCxQF/nqXn1dgVTchB1+tozL2F1OtOCq6WpzhoD2jgzV6nv9fwO5Ow t2T2oylzK6rGYsmZLVQ413y+4oDufWI49K+00Se2lzU6apL7HEyDa3JWpc9+RnuemD+k nVjgMihFEYWWwwIBbv4Lsr7JhO4N7jxjCxpTkPcD84khCcK8ZjEzYjE2KBr8uqEZNPVK lPrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=d6vYcRVAHTF9j2q3sJyjRxwMHljUulsTEakzBs9ZY84=; b=wyMkrMoNSLCvb+yzJtAfNq0jGSFaihnPGnT5JAlcJw0gG63hAkdSbzuC3eBrIdIokh lGwVFyD7707Ecy+/VUTszf2O5fH6t/5px4PrNAa9HjMVjNMtEtoRYY9ichdQgka9o6IJ h/hU4r1B6WIDlejwznnOkEtDXHIs//ax40P1JM+i2HKR/ASFQ/Udwvn070Q+8CBLxw0d BoWTeoa3oe7UBZm7d8AaRrDzbk/2nyiDZEmuhhbdihh3I/XHeZvZB/ZVXryBQes7Jr5N 8wSavU7zsCKIHJAezubUcSy40CKAqJDPExp0pExAuEDgDnTt15HDxNJ0qikL5q/1YNhK bReA== 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 u12si1089582otq.51.2020.01.10.03.38.12; Fri, 10 Jan 2020 03:38:24 -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 S1727746AbgAJLhQ (ORCPT + 99 others); Fri, 10 Jan 2020 06:37:16 -0500 Received: from foss.arm.com ([217.140.110.172]:42818 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727457AbgAJLhP (ORCPT ); Fri, 10 Jan 2020 06:37:15 -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 498D01063; Fri, 10 Jan 2020 03:37:15 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EA9CA3F534; Fri, 10 Jan 2020 03:37:13 -0800 (PST) Date: Fri, 10 Jan 2020 11:37:11 +0000 From: Sudeep Holla To: Jeffy Chen Cc: linux-kernel@vger.kernel.org, Brian Norris , Marc Zyngier , Douglas Anderson , Robin Murphy , Heiko Stuebner , Sudeep Holla , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: Re: [PATCH v1] arch_topology: Adjust initial CPU capacities with current freq Message-ID: <20200110113711.GB39451@bogus> References: <20200109075214.31943-1-jeffy.chen@rock-chips.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200109075214.31943-1-jeffy.chen@rock-chips.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Regards, Sudeep