Re: [PATCH 2/6] cpufreq: Replace few CPUFREQ_CONST_LOOPS checks with has_target()

From: Viresh Kumar
Date: Wed Jun 19 2019 - 10:23:16 EST


On 19-06-19, 14:20, Rafael J. Wysocki wrote:
> On Wed, Jun 19, 2019 at 1:36 PM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
> > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> > index 54befd775bd6..e59194c2c613 100644
> > --- a/drivers/cpufreq/cpufreq.c
> > +++ b/drivers/cpufreq/cpufreq.c
> > @@ -359,12 +359,10 @@ static void cpufreq_notify_transition(struct cpufreq_policy *policy,
> > * which is not equal to what the cpufreq core thinks is
> > * "old frequency".
> > */
> > - if (!(cpufreq_driver->flags & CPUFREQ_CONST_LOOPS)) {
> > - if (policy->cur && (policy->cur != freqs->old)) {
> > - pr_debug("Warning: CPU frequency is %u, cpufreq assumed %u kHz\n",
> > - freqs->old, policy->cur);
> > - freqs->old = policy->cur;
> > - }
> > + if (has_target() && policy->cur && policy->cur != freqs->old) {
> > + pr_debug("Warning: CPU frequency is %u, cpufreq assumed %u kHz\n",
> > + freqs->old, policy->cur);
> > + freqs->old = policy->cur;
>
> Is cpufreq_notify_transition() ever called if ->setpolicy drivers are in use?

I tried to find it, but I couldn't find any driver from where we can
get this called for setpolicy drivers.

--
viresh