From: Mark Langsdorf <mark.langsdorf@amd.com>
To: <linux-kernel@vger.kernel.org>, <cpufreq@vger.kernel.org>,
<bhavna.sarathy@amd.com>, <joachim.deguara@amd.com>,
<borislav.petkov@amd.com>
Subject: [PATCH 3/3] cpufreq: add sysfs knob for toggling core performance boost
Date: Wed, 3 Mar 2010 14:59:27 -0600 [thread overview]
Message-ID: <201003031459.27757.mark.langsdorf@amd.com> (raw)
>From 1ba7af20a37b72a4375d3e3ddd33a033f204ee21 Mon Sep 17 00:00:00 2001
From: Mark Langsdorf <mark.langsdorf@amd.com>
Date: Wed, 3 Mar 2010 14:34:47 -0600
Subject: [PATCH 2/2] cpufreq: add sysfs knob for toggling core performance boost
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Tested-by: Mark Langsdorf <mark.langsdorf@amd.com>
---
drivers/cpufreq/cpufreq.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 67bc2ec..e0fe93f 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -662,6 +662,30 @@ static ssize_t show_bios_limit(struct cpufreq_policy *policy, char *buf)
return sprintf(buf, "%u\n", policy->cpuinfo.max_freq);
}
+static ssize_t store_cpb(struct cpufreq_policy *policy, const char *buf,
+ size_t count)
+{
+ int ret = -EINVAL;
+ unsigned long val = 0;
+
+ ret = strict_strtoul(buf, 10, &val);
+ if (!ret && (val == 0 || val == 1))
+ policy->flags.cpb = val;
+ else
+ return -EINVAL;
+
+ ret = __cpufreq_driver_target(policy, policy->cur, CPUFREQ_RELATION_H);
+ if (ret)
+ return -EINVAL;
+
+ return count;
+}
+
+static ssize_t show_cpb(struct cpufreq_policy *policy, char *buf)
+{
+ return sprintf(buf, "%u\n", policy->flags.cpb);
+}
+
#define define_one_ro(_name) \
static struct freq_attr _name = \
__ATTR(_name, 0444, show_##_name, NULL)
@@ -688,6 +712,7 @@ define_one_rw(scaling_min_freq);
define_one_rw(scaling_max_freq);
define_one_rw(scaling_governor);
define_one_rw(scaling_setspeed);
+define_one_rw(cpb);
static struct attribute *default_attrs[] = {
&cpuinfo_min_freq.attr,
@@ -701,6 +726,7 @@ static struct attribute *default_attrs[] = {
&scaling_driver.attr,
&scaling_available_governors.attr,
&scaling_setspeed.attr,
+ &cpb.attr,
NULL
};
--
1.6.0.2
next reply other threads:[~2010-03-03 20:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-03 20:59 Mark Langsdorf [this message]
2010-03-04 21:27 ` [PATCH 3/3] cpufreq: add sysfs knob for toggling core performance boost Andrew Morton
2010-03-04 21:49 ` Borislav Petkov
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=201003031459.27757.mark.langsdorf@amd.com \
--to=mark.langsdorf@amd.com \
--cc=bhavna.sarathy@amd.com \
--cc=borislav.petkov@amd.com \
--cc=cpufreq@vger.kernel.org \
--cc=joachim.deguara@amd.com \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.