From: "Kasagar, Srinidhi" <srinidhi.kasagar@intel.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Dirk Brandewie <dirk.j.brandewie@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
vishwesh.m.rudramuni@intel.com, srinidhi.kasagar@intel.com
Subject: Re: [PATCH] cpufreq: Add sfi based cpufreq driver support
Date: Thu, 9 Oct 2014 23:38:26 +0530 [thread overview]
Message-ID: <20141009180826.GA32265@intel-desktop> (raw)
In-Reply-To: <CAKohpom+Ey75QStm_xsVeC7arN_5a3+q_Nf8pvadTxNaLBKCEw@mail.gmail.com>
On Thu, Oct 09, 2014 at 09:33:24AM +0530, Viresh Kumar wrote:
> On 9 October 2014 00:44, Kasagar, Srinidhi <srinidhi.kasagar@intel.com> wrote:
> > On Tue, Oct 07, 2014 at 03:52:42PM +0530, Viresh Kumar wrote:
> >> > +static int sfi_cpufreq_target(struct cpufreq_policy *policy,
> >> > + unsigned int index)
> >> > +{
> >> > + struct sfi_cpufreq_data *data = per_cpu(drv_data, policy->cpu);
> >> > + struct sfi_processor_performance *perf;
> >> > + unsigned int next_perf_state = 0; /* Index into perf table */
> >> > + u32 lo, hi;
> >>
> >> You meant unsigned int only?
> >
> > Yes.
>
> Then use that only to be aligned with other data types.
Sorry, I meant it should be u32 as they are register reads.
>
> >> > + perf = data->sfi_data;
> >> > + next_perf_state = data->freq_table[index].driver_data;
> >> > + if (perf->state == next_perf_state) {
> >>
> >> Can this happen? Probably cpufreq core will never do it ?
> >
> > I think it did. Let me keep this.
>
> Okay, but how? The cpufreq core doesn't propagate call to ->target_index()
> if the freq isn't changing.. Please check if this is getting hit at all or not.
I guess if you offline a cpu and then bring it online, then even though
there is no change in frequency, the core calls ->target_index().
am i missing something?
>
> >> > +static int sfi_cpufreq_resume(struct cpufreq_policy *policy)
> >> > +{
> >> > + struct sfi_cpufreq_data *data = per_cpu(drv_data, policy->cpu);
> >>
> >> Your code is dependent on policy->cpu at multiple places and it can change on
> >> CPU hotplug. You should worry about it only if there can be more than one CPU
> >> in a single policy, which doesn't look like the case.
> >
> > Not sure what do you mean by not using policy->cpu. I need all of these
> > to support hotplug. Can you elaborate if you mean otherwise please?
>
> So you are using policy->cpu to set/get a value out of a per-cpu variable.
> Now if a policy has 4 cpus then per-cpu variable will only be initialized for
> policy->cpu and not others.
>
> But now if we do hotplug of that cpu, policy->cpu will move to next cpu.
> In this case accessing the per-cpu variable will not be a good idea :)
Not sure what I can do with this. Let me have a look.
Srinidhi
next prev parent reply other threads:[~2014-10-09 10:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 14:07 [PATCH] cpufreq: Add sfi based cpufreq driver support Kasagar, Srinidhi
2014-10-07 10:22 ` Viresh Kumar
2014-10-08 19:14 ` Kasagar, Srinidhi
2014-10-09 4:03 ` Viresh Kumar
2014-10-09 18:08 ` Kasagar, Srinidhi [this message]
2014-10-09 10:18 ` Viresh Kumar
2014-10-09 19:07 ` Kasagar, Srinidhi
2014-10-09 11:15 ` Viresh Kumar
2014-10-10 16:51 ` Kasagar, Srinidhi
2014-10-10 8:57 ` Viresh Kumar
2014-10-10 17:14 ` Kasagar, Srinidhi
2014-10-10 9:27 ` Viresh Kumar
2014-10-10 10:47 ` Kasagar, Srinidhi
2014-10-10 11:11 ` Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141009180826.GA32265@intel-desktop \
--to=srinidhi.kasagar@intel.com \
--cc=dirk.j.brandewie@intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=viresh.kumar@linaro.org \
--cc=vishwesh.m.rudramuni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).