Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752212AbdFLOpt (ORCPT ); Mon, 12 Jun 2017 10:45:49 -0400 Received: from mail-lf0-f54.google.com ([209.85.215.54]:35232 "EHLO mail-lf0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752009AbdFLOpr (ORCPT ); Mon, 12 Jun 2017 10:45:47 -0400 MIME-Version: 1.0 In-Reply-To: <20170608075513.12475-2-dietmar.eggemann@arm.com> References: <20170608075513.12475-1-dietmar.eggemann@arm.com> <20170608075513.12475-2-dietmar.eggemann@arm.com> From: Vincent Guittot Date: Mon, 12 Jun 2017 16:45:25 +0200 Message-ID: Subject: Re: [PATCH 1/6] drivers base/arch_topology: prepare cpufreq policy notifier for frequency-invariant load-tracking support To: Dietmar Eggemann Cc: linux-kernel , "linux-pm@vger.kernel.org" , Russell King - ARM Linux , LAK , Greg Kroah-Hartman , Russell King , Catalin Marinas , Will Deacon , Juri Lelli , Vincent Guittot , Peter Zijlstra , Morten Rasmussen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2030 Lines: 41 On 8 June 2017 at 09:55, Dietmar Eggemann wrote: > This patch prepares the actual implementation of the frequency-invariant > load-tracking support provided in the next patch ("drivers > base/arch_topology: frequency-invariant load-tracking support"). > > The maximum supported frequency of a cpu (policy->cpuinfo.max_freq) has > to be retrieved for frequency-invariant load-tracking. > > This can be achieved by coding this functionality into the existing > cpufreq policy notifier (init_cpu_capacity_notifier) which is currently > only used for setting up dt-based cpu capacities (cpu node property > capacity-dmips-mhz). > > But frequency-invariant load-tracking has to work whether cpu capacity > dt-parsing succeeded or not. > > Change init_cpu_capacity_notifier in such a way that even if the parsing > of the cpu capacity information failed the notifier is called for each > cpufreq policy to be able to set the maximum supported frequency. > > The exit condition in register_cpufreq_notifier() now only tests for > !acpi_disabled because for frequency invariance the cpufreq policy > notifier has to be enabled even if u32 *raw_capacity is NULL which > occurs when there is no capacity-dmips-mhz property in the dt file or > when the allocation for raw_capacity[cpu] has failed. > > The continue statement in init_cpu_capacity_callback() makes sure that > we don't go on calculating capacity_scale in case the capacity parsing > failed. It should be a break rather a continue here but the next patch > introduces code to set the per-cpu variable max_freq in this > for_each_cpu loop before the check if cap_parsing_failed so it has to > be a continue. > > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Russell King > Cc: Greg Kroah-Hartman > Cc: Juri Lelli > Signed-off-by: Dietmar Eggemann Acked-by: Vincent Guittot