Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp60748pxv; Thu, 24 Jun 2021 02:49:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZcbw5nHVh9LJRR3HIvlBsLHz/NhVOoifMPJhCG6r4/7V5GWKQtjGPjhTSwR92iP25N4dO X-Received: by 2002:a17:906:90c4:: with SMTP id v4mr4346360ejw.382.1624528190566; Thu, 24 Jun 2021 02:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624528190; cv=none; d=google.com; s=arc-20160816; b=0gIOwhvgjwCUbO0tx5Fv3Jj2FsLsFG7W/KXkvdKDwrZLrBwg6qZ1fGU6WmJNUDDXJO uAOkfzMswxpqnj8N/HIW+ZXwK+qdWCNJg3Wj0fvhQwyOLDXKPnaQazIrv/Ystak+AvFX 31TanQleh7Ugpzv39ciV+8T5c9ZZLsKAmmueWg+6ua7AOO1HBunj1oQ1cXLc7COvZScz QQb5q8GKjEPVaREXro0y4Q6wYnx+mzOKxBCv340yVWng8FgBrRDpxUAsnJwAkcJL2Fs9 h2fTQDUJGpeGDkTemdWWe+QJdLcPWixRkSmWBejyPiqMAEtaemuCyq2wNwj0ycLX1V+G MHdw== 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; bh=TkWfn1dpW1uy/4lb2kmzeFl+SAzVJGoU3i68S7fOr1g=; b=r9He2GlWg9NAWLxcOPKb1Pgnlb528jS//jf+gLbuxeld7ig0k4tGRhGU86tN6HhS7a 7Vu2gvb4NMv6eCZVyfnb93gMxRLdEfzGc8/3cZKDX15czda/5qRyGX0C7TDXjtYWJ+KP P/MJj96DMlzfIS1LSlzC03H8+anJwJZn/f9JINcmIg/LwcLU6x/Ax5hak0/zOEXR2g2q Z1nA4yN9qI1yAUe7PNDutmgkzQjs23d7gVwsu4RByuJsszL0DiCwq/RWvZhu6vLd81ly 2BBYPJvcgriSy5YdW4TD4PbxQ7B0Lcn/tvIrIPXmLDcnti8ZSg+46l2T2q7Vwmqnr9d8 rDLw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u3si2600276edy.407.2021.06.24.02.49.27; Thu, 24 Jun 2021 02:49:50 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232016AbhFXJue (ORCPT + 99 others); Thu, 24 Jun 2021 05:50:34 -0400 Received: from foss.arm.com ([217.140.110.172]:51948 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbhFXJud (ORCPT ); Thu, 24 Jun 2021 05:50:33 -0400 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 50A6E1042; Thu, 24 Jun 2021 02:48:14 -0700 (PDT) Received: from localhost (unknown [10.1.195.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E40043F718; Thu, 24 Jun 2021 02:48:13 -0700 (PDT) Date: Thu, 24 Jun 2021 10:48:12 +0100 From: Ionela Voinescu To: Viresh Kumar 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: <20210624094812.GA6095@arm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey, 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.. > + irq_work_sync(&cppc_fi->irq_work); > + kthread_cancel_work_sync(&cppc_fi->work); > + } > +} The rest of the code is almost the same as the original, so that is all from me :). Thanks, Ionela.