From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: rafael.j.wysocki@intel.com, viresh.kumar@linaro.org
Cc: linux-pm@vger.kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [RFC PATCH 3/3] cpufreq: acpi_cpufreq: Support base_frequency
Date: Fri, 4 Sep 2015 10:19:19 -0700 [thread overview]
Message-ID: <1441387159-19860-3-git-send-email-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <1441387159-19860-1-git-send-email-srinivas.pandruvada@linux.intel.com>
Using new cpufreq base_frequency, displaying the correct base frequency.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
---
drivers/cpufreq/acpi-cpufreq.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 0136dfc..4350809 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -640,6 +640,19 @@ static int acpi_cpufreq_blacklist(struct cpuinfo_x86 *c)
}
#endif
+static int acpi_cpufreq_get_base_frequency(int cpu, unsigned int *start)
+{
+ u64 tar;
+ int err;
+
+ err = rdmsrl_safe_on_cpu(cpu, MSR_TURBO_ACTIVATION_RATIO, &tar);
+ if (!err)
+ /* only supported in core cpus so scaling is fixed */
+ *start = tar * 100000;
+
+ return err;
+}
+
static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)
{
unsigned int i;
@@ -916,6 +929,18 @@ static void __init acpi_cpufreq_boost_init(void)
__register_cpu_notifier(&boost_nb);
cpu_notifier_register_done();
+
+ /* Check if we need to register base freq */
+ if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) {
+ u64 tar;
+ int err;
+
+ err = rdmsrl_safe(MSR_TURBO_ACTIVATION_RATIO, &tar);
+ if (!err)
+ acpi_cpufreq_driver.base_frequency =
+ acpi_cpufreq_get_base_frequency;
+ }
+
}
}
--
2.4.3
next prev parent reply other threads:[~2015-09-04 17:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 17:19 [RFC PATCH 1/3] cpufreq: Add new attribute "base_frequency" Srinivas Pandruvada
2015-09-04 17:19 ` [RFC PATCH 2/3] cpufreq: user_guide: update for base_frequency Srinivas Pandruvada
2015-09-04 17:19 ` Srinivas Pandruvada [this message]
2015-09-07 6:06 ` [RFC PATCH 1/3] cpufreq: Add new attribute "base_frequency" Viresh Kumar
2015-09-07 15:17 ` Srinivas pandruvada
2015-09-07 15:31 ` 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=1441387159-19860-3-git-send-email-srinivas.pandruvada@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=viresh.kumar@linaro.org \
/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).