From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61425C49EA5 for ; Thu, 24 Jun 2021 13:04:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3FE4F613F3 for ; Thu, 24 Jun 2021 13:04:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230461AbhFXNGm (ORCPT ); Thu, 24 Jun 2021 09:06:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbhFXNGl (ORCPT ); Thu, 24 Jun 2021 09:06:41 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB26DC061756 for ; Thu, 24 Jun 2021 06:04:21 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id i4so2907514plt.12 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=uba+fhMfcnwcJz4DyEV1qPtvsqKU3GEcgN3TfT303tb/Zom6wb9UXH7SLRmRNNyy2l cHKVzmkYEEeDDLjxIzoicMObMH+QvGf7I4MKA8jrJCc/7cD2OeeS4NHUSWv/NWYXRMiO 6aJz/uSvV85sjRFI8+LCdZWllK9QjxZsf3OmML46PYNimn7Aqv7DVrHP3+nllXFjrml2 qK6tqp5KUQsF7WWAJDVZbUd5B6QpyC+tHyo/TALIstrUBGX0DCCZgSZDNkVXrZVopGpq +pjBOYN69Wj1MD6IxzLnzGJK/tss/pn33KLOSE5UbT6g/L0vWXhWi9IMpLWRGLAlC48W W6CA== X-Gm-Message-State: AOAM5335dAOFvRzGPTvDzFhamhn0aO4hirKtnaUNBWsuzwSsyH/yxoXr jXn20jRFCV0X2GRdkg27DSeFjA== X-Google-Smtp-Source: ABdhPJweRjj1DyWQN243gjZPbzlvBG/0RsodAwHklaoU6e9TQQVR9vl2qjHLWzPgXf7baUP16THj5g== 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-acpi@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