Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp195639pxv; Thu, 24 Jun 2021 06:05:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmpozKcjd4KnxYCcxTbzjFBwnnWwaT73baEOd9oiBIaX6wpyLBs3/hlZkLpAxZYsolALeW X-Received: by 2002:a05:6e02:1d92:: with SMTP id h18mr3591949ila.258.1624539928880; Thu, 24 Jun 2021 06:05:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624539928; cv=none; d=google.com; s=arc-20160816; b=nFmCvt+BMtcvnh6AY6EtHWIFYEA6xfee3eWjKhVRvJm5VGBS1/jtDWX7wMDJD0XVGM JD6l/HR/Z3LiJchXcaJS5QEos67smTTpgMHrq+bmen7wkOtcrhxRl8YOgIU2Nc1Q9Hej Z/FkpZK/pataKTYiXECFJ0yFSCNzj+0rfAfsXADXRINVnB3CGYavASazYvEoZGuXXQbX QJ/nZNvk59GayklQoPAVa6AZSs9d7Jvwh1QP1IZXL11owsavxC/fh9dDU3Am8jvr3T77 Z6jlyBF8aC41PhR2IWU4KUJaIxROtXvowFBACYXRqWCOX0TkvzH7fIRSjQFzNfVIbNN2 9U2Q== 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=sFN5Cy+47yYqPOhkIowUt/KKxpMi4IaFOzdHw+hWIB4=; b=NGIyezckwjw/NLRp9nd6ckH7V6vVjvTOMXs+TL1RWn29yrqz+PAkrr9QKi1CBi5Anw jDPz7EPZrcJSCWY49se6zrbOK78zRV/rwjimN6kxvB2AcAtStsaLfKTj3B2HQfygOXHk szI1yLXCTZlKpNnufcHxSg6ChJLPhJqtIDqSw+/+hpTP9s2ztBNCcz4LrtkRT9v6Kdya 6Ez1khgqnLRdcfzTmOZ95sDm3DXjjNvbl3wCeG1uo0a4klr3krbT+WAg5zkUb2lswfqV YvrRfiWzQJqT0MQhXvXmSpYoJ2ESgZ6EoPGhNeAeld4ZXjaKmRKxUn8GgtYjUE7JOGE/ 3yig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=euHTIFBi; 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 u12si3339601iln.143.2021.06.24.06.05.16; Thu, 24 Jun 2021 06:05:28 -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=euHTIFBi; 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 S229995AbhFXNGp (ORCPT + 99 others); Thu, 24 Jun 2021 09:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230450AbhFXNGl (ORCPT ); Thu, 24 Jun 2021 09:06:41 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC911C06175F for ; Thu, 24 Jun 2021 06:04:21 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id u2so2932539plf.3 for ; Thu, 24 Jun 2021 06:04:21 -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=sFN5Cy+47yYqPOhkIowUt/KKxpMi4IaFOzdHw+hWIB4=; b=euHTIFBiUTAQEYlhiVPJ4XThSS9vcimvbD0wrEXm0OBwQ6mdsWKbkXLoaSMh2A+F/Z zA7VEK4BdIcfe+EoGiqZN34QYw0rxwMDlkQWslmdHqQn7KhzOQJ5vcPM5DWNFRztyacb kS4w6v5rp0lPD+sUu4FvwUnejKWbQHuRRx4nSJju/vqPK/fdTRCokIYBOTgUCvMcMgcR uJZvn2pGLYQa99fux/r4SOtZ9GQXC54xhxTZWVU1fk5SRH5h1ff6F182Acn/asQ60xbJ DgbucJsvDmdj/ldggbzRJFpfL9+y21DnEuexsxMcTUuROB7oIptFRozDNqUb7TpZgZ6h Ja2A== 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=sFN5Cy+47yYqPOhkIowUt/KKxpMi4IaFOzdHw+hWIB4=; b=GHU3hHj/aTZFbJrCstpLmmks+1CmsaDLBBcQZCAPQkc9gLKifd4vXSQds6dPO7/mz+ YBChcpC47OA84tc7l9HewMK8aaiJz7K/4OO0LJaNAXbxOObNR97yAetzixjYKbGwKNH5 qvOHIcEw6dCsEJifFgt8LFH4T6LncFugZSBlrN0IA3TFFXRlEjfR9no8okJSpGLXYBu6 TOI27eV/ZoYv3WUUjtMv85DmZim//wLAd16XXt74OogqX/MoGXqwjgVFNAuTcGpKaud9 CNvr57i6HoaQF4/0WAUviWZcdwmMmGdQ22YBFAexhYvGxRcQpRUjghwXGtFHr4lpCFnh n50w== X-Gm-Message-State: AOAM532DyeOElp0Ca8t3ik6goOgeiZXJXTfluqcmlVUoO63ZxHEOvE1w /HI09HFiYBmz2dnLjb/5hshYJQ== X-Received: by 2002:a17:90a:73ca:: with SMTP id n10mr15114543pjk.16.1624539861249; Thu, 24 Jun 2021 06:04:21 -0700 (PDT) Received: from localhost ([136.185.134.182]) by smtp.gmail.com with ESMTPSA id b9sm2712841pfm.124.2021.06.24.06.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Jun 2021 06:04:20 -0700 (PDT) Date: Thu, 24 Jun 2021 18:34: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: <20210624130418.poiy4ph66mbv3y67@vireshk-i7> References: <20210624094812.GA6095@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210624094812.GA6095@arm.com> User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ? > > + 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. -- viresh