From: Quentin Perret <quentin.perret@arm.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Linux PM <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Chen Yu <yu.c.chen@intel.com>,
Gabriele Mazzotta <gabriele.mzt@gmail.com>
Subject: Re: [PATCH v2 3/3] cpufreq: intel_pstate: Update max frequency on global turbo changes
Date: Tue, 5 Mar 2019 11:42:54 +0000 [thread overview]
Message-ID: <20190305114252.wu55upnrzb5j2g7j@queper01-lin> (raw)
In-Reply-To: <258653930.nEdAsQ7rt7@aspire.rjw.lan>
On Tuesday 05 Mar 2019 at 11:42:06 (+0100), Rafael J. Wysocki wrote:
> +static void intel_pstate_update_max_freq(unsigned int cpu)
> +{
> + struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpu);
> + struct cpufreq_policy new_policy;
> + struct cpudata *cpudata;
> +
> + if (!policy)
> + return;
> +
> + cpudata = all_cpu_data[cpu];
> + policy->cpuinfo.max_freq = global.turbo_disabled_mf ?
> + cpudata->pstate.max_freq : cpudata->pstate.turbo_freq;
I'm not too familiar with how the Intel turbo stuff so bear with me but
is this 'pstate.turbo_freq' constant ?
Why not just write it unconditionally into cpuinfo.max_freq ? It's not
guaranteed to always be reachable anyways no ? So maybe that's OK to always
report that one regardless of the boost availability ?
> + memcpy(&new_policy, policy, sizeof(*policy));
> + new_policy.max = min(policy->user_policy.max, policy->cpuinfo.max_freq);
> + new_policy.min = min(policy->user_policy.min, new_policy.max);
> +
> + cpufreq_set_policy(policy, &new_policy);
> +
> + cpufreq_cpu_release(policy);
> +}
Thanks,
Quentin
next prev parent reply other threads:[~2019-03-05 11:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-05 10:23 [PATCH v2 0/3] cpufreq: intel_pstate: Handle _PPC updates on global turbo disable/enable Rafael J. Wysocki
2019-03-05 10:30 ` [PATCH v2 1/3] cpufreq: intel_pstate: Driver-specific handling of _PPC updates Rafael J. Wysocki
2019-03-05 10:37 ` [PATCH v2 2/3] cpufreq: Add cpufreq_cpu_acquire() and cpufreq_cpu_release() Rafael J. Wysocki
2019-03-05 10:42 ` [PATCH v2 3/3] cpufreq: intel_pstate: Update max frequency on global turbo changes Rafael J. Wysocki
2019-03-05 11:42 ` Quentin Perret [this message]
2019-03-05 11:55 ` Rafael J. Wysocki
2019-03-06 11:01 ` [PATCH v2 0/3] cpufreq: intel_pstate: Handle _PPC updates on global turbo disable/enable 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=20190305114252.wu55upnrzb5j2g7j@queper01-lin \
--to=quentin.perret@arm.com \
--cc=gabriele.mzt@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=viresh.kumar@linaro.org \
--cc=yu.c.chen@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
all inboxes | Powered by JetHome®