[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210624130418.poiy4ph66mbv3y67@vireshk-i7>
Date: Thu, 24 Jun 2021 18:34:18 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Ionela Voinescu <ionela.voinescu@....com>
Cc: Rafael Wysocki <rjw@...ysocki.net>,
Sudeep Holla <sudeep.holla@....com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
linux-pm@...r.kernel.org, Qian Cai <quic_qiancai@...cinc.com>,
linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V3 4/4] cpufreq: CPPC: Add support for frequency
invariance
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
Powered by blists - more mailing lists