Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1309968pxv; Fri, 25 Jun 2021 09:55:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwk4FZTQ1sFyVI/3YmOLNfce9R8yDOvL2e4+AoABGLRVUevd13cnxch2IvHoU6hZCKHSQvH X-Received: by 2002:a17:907:ea6:: with SMTP id ho38mr11770322ejc.435.1624640152280; Fri, 25 Jun 2021 09:55:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624640152; cv=none; d=google.com; s=arc-20160816; b=qUsLo6nAEEH6SETpo5jvU46Wxm84lk+WVhsXBbL66UaQ+vF14z49PVLx4jmaSaEnZn 1Jp0rysR1vzOU7b6iEUEYI160kqA7VRxYo60TUAxHGYPSObUO6WXH+yD8d3MlY4IS7CD 9yROEujtb4iBn0ROU9QQxTIWj+vdJBVzk5aD5Pgapem+N4xSoglOPdEwoirdI4/jNg2A E6NyhwLqLxAZX/DDT1TCRncBENmKtycuPTJAfKeDjK7f8mriGBBclh9czVDthBFRSmSK BoU04+OIz4vuZNcgY/MPuBjgZUo5P6rh6WCvKwKSPWmy7H5lgcBleLIZyazDUFx5XQpf IbEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=l7dX5dgpmPFuySJbZwA/qhXdydYfRA2CAHeZv6VJOdk=; b=l7tu2qaZdl+OHAAGDN9s5S/EKib2j8+/lDlYWJHck/LSzUhACK+ABr8CsiqN/8F4Ii Jv0FXtpmieNmocSXcDqENPaXSUO2TVPzIzUuLVjNIw8ExXldiPZFwHGg8pFzB5cL0CY8 G+D/8lPFIX4wY3hFEz+zS8clP1FSIhl5bkbmWPkGd7RXQUbsf6Jp68m66Ss/R9ahL1b7 CQOTBU3fBYbStCDyyCLGtfte62iXdl5p7nzt/v2FyoydkH1TQ3dYeCB0YV/d79wEjKdd f9xBcOoHDuVeOUvmyM38NF4Q/4jSgccKDEno2VTuGUoqbPFnaowfjsIhVnlMEVy8kUpB QffA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iqLixdZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r7si6945227edq.396.2021.06.25.09.55.28; Fri, 25 Jun 2021 09:55:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iqLixdZ4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbhFYQ4o (ORCPT + 99 others); Fri, 25 Jun 2021 12:56:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbhFYQ4o (ORCPT ); Fri, 25 Jun 2021 12:56:44 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A138C061766 for ; Fri, 25 Jun 2021 09:54:22 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id u2so5025818plf.3 for ; Fri, 25 Jun 2021 09:54:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=l7dX5dgpmPFuySJbZwA/qhXdydYfRA2CAHeZv6VJOdk=; b=iqLixdZ4UQzIfrMpWEvBZKk5Fvm5nRLt8h9LHj6PsJATVMPi7t0AV1zK5ok8y6mRpP +M8ZOCK/fdssvSFI6zERVDwSO0CDJKSow466MIVRQOMvAPt/3YvcZMXzOmooS3BsNUz8 aZsOdhZi6YjFTNoNOv1FnZgYDkyYti0HOxNk6ztUJX2NweNGCSJ8iJE762SgA7Loi333 S0LK6OC2LSk9yFqBz/NtkI0obfj2RJSGpHwnYt3uFzpzz5dFzr+CKvb95L5lGFpMROQn Nqw/9cNf3YHkpLw0oADqyiPOY42p4HIc0IHJMdkevGMH5NNE0TklGkeGQNzXcUxWFWBy 5Hfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=l7dX5dgpmPFuySJbZwA/qhXdydYfRA2CAHeZv6VJOdk=; b=CP374hbK4hOIkMkh5acw7ECZteRsLxGf+l4peq1NdLwY9I/IUXvS65XcB6TzRYyIHa PvhxHe8LJxL02FkcZBbHCGIe7/Amqx/OQ0o5GV58gj/msSFRMmfjVzNOhbrzl/sa8VT3 NlMzduHGzryuctVbrT7t20p18+cp7plPqVCTmX6o480udw8kDF9MpsMQ4qD3Oc+hHG2z csIi8k/qDLCzMCaYIZQAJEiGbAuK5IcXnL6FniCOMoWqMX+sxF3aMvH2qJdavVfAruDN SigS+RgoYvqB7+Bq7hl9RB63gW5u49PXA6rTGo2d64pTYNVeOkZVYMLMCZaQwwtmOgnQ 9cRA== X-Gm-Message-State: AOAM531K9ZMdO7zj3QG7JA0cIA14voa+1FqenoD8OA3I4kTcBSYGYww6 jrWM+NB0sG6J3EyXJ0dgMVz0lQ== X-Received: by 2002:a17:90b:1809:: with SMTP id lw9mr12225978pjb.128.1624640061688; Fri, 25 Jun 2021 09:54:21 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id b9sm5826453pfm.124.2021.06.25.09.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Jun 2021 09:54:21 -0700 (PDT) Date: Fri, 25 Jun 2021 22:24:18 +0530 From: Viresh Kumar To: Ionela Voinescu Cc: Rafael Wysocki , Sudeep Holla , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , linux-pm@vger.kernel.org, Qian Cai , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V3 4/4] cpufreq: CPPC: Add support for frequency invariance Message-ID: <20210625165418.shi3gkebumqllxma@vireshk-i7> References: <20210624094812.GA6095@arm.com> <20210624130418.poiy4ph66mbv3y67@vireshk-i7> <20210625085454.GA15540@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210625085454.GA15540@arm.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25-06-21, 09:54, Ionela Voinescu wrote: > Hey, > > On Thursday 24 Jun 2021 at 18:34:18 (+0530), Viresh Kumar wrote: > > On 24-06-21, 10:48, Ionela Voinescu wrote: > > > On Monday 21 Jun 2021 at 14:49:37 (+0530), Viresh Kumar wrote: > > > > The Frequency Invariance Engine (FIE) is providing a frequency scaling > > > > correction factor that helps achieve more accurate load-tracking. > > > [..] > > > > +static void cppc_cpufreq_cpu_fie_exit(struct cpufreq_policy *policy) > > > > +{ > > > > + struct cppc_freq_invariance *cppc_fi; > > > > + int cpu; > > > > + > > > > + if (cppc_cpufreq_driver.get == hisi_cppc_cpufreq_get_rate) > > > > + return; > > > > + > > > > + /* policy->cpus will be empty here, use related_cpus instead */ > > > > + topology_clear_scale_freq_source(SCALE_FREQ_SOURCE_CPPC, policy->related_cpus); > > > > + > > > > + for_each_cpu(cpu, policy->related_cpus) { > > > > + cppc_fi = &per_cpu(cppc_freq_inv, cpu); > > > > > > Do you think it might be worth having here something like: > > > > > > if (!cppc_fi->cpu_data) > > > continue; > > > > > > This would be to protect against cases where the platform does not boot > > > with all CPUs or the module is loaded after some have already been > > > offlined. Unlikely, but.. > > > > Even in that case policy->cpus will contain all offline+online CPUs (at ->init() > > time), isn't it ? > > > > Right, my bad. I missed cpumask_and(policy->cpus, policy->cpus, > cpu_online_mask) being done after init(). It logically seems a bit > wrong, but drivers are in control of setting policy->cpus and acting on > it, and in this case the driver does the right thing. Do you want me to re-add your Reviewed-by here ? -- viresh