Add P state driver for Intel Core Processors
Subsystems (3)
cover Add P state driver for Intel Core Processors
From: Dirk Brandewie <[email protected]>
This driver implements a scaling driver with an internal governor for Intel Core processors. The driver follows the same model as the Transmeta scaling driver (longrun.c) and implements the setpolicy() instead of target(). Scaling drivers that implement setpolicy() are assmuned to implement internal governors by the cpufreq core. All the logic for selecting the current P state is contained within the driver no external governor is used by the cpufreq core.
At the moment only Intel SandyBridge processors are supported. As testing on SandyBridge+ processors is completed support will be added to the driver.
New sysfs files for controlling P state selection have been added to /sys/devices/system/cpu/intel_pstate/
max_perf_pct: limits the maximum P state that will be requested by the driver stated as a percentage of the avail performance.
min_perf_pct: limits the minimum P state that will be requested by the driver stated as a percentage of the avail performance.
no_turbo: limits the driver to selecting P states below the turbo frequency range.
The units for these for these files are purposely abstract and stated in terms of available performance and not frequency. In idea that frequency can be set to a single frequency is a fiction for Intel Core processors. Even if the scaling driver selects a single P state the actual frequency the processor will run at is selected by the processor
Changes since last version:
Dropped unneeded patches.
Rebased on bleeding edge 1071b3b
Patch 1:
updated per Viresh's comments, added his ack.
Patch 2:
updated description to be more informative and move the check as to whether the scaling driver implements target() to only effect whether cpufreq_out_of_sync() is called
Patch 3:
Added Viresh's Ack
Patch 4:
Upadted to not use unneeded local variable
Dirk Brandewie (5):
cpufreq: Retrieve current frequency from scaling drivers with
internal governors
cpufreq: Only call cpufreq_out_of_sync() with drivers that implement
cpufreq_driver.target()
cpufreq: Do not track governor name for scaling drivers with internal
governors.
cpufreq_stats: do not remove sysfs files if frequency table is not
present
cpufreq/x86: Add P-state driver for sandy bridge.
drivers/cpufreq/Kconfig.x86 | 18 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/cpufreq.c | 13 +- drivers/cpufreq/cpufreq_stats.c | 4 + drivers/cpufreq/intel_pstate.c | 829 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 862 insertions(+), 3 deletions(-) create mode 100644 drivers/cpufreq/intel_pstate.c
Signature · 1 line
1.7.7.6
PATCH 1/5 cpufreq: Retrieve current frequency from scaling drivers with internal governors
From: Dirk Brandewie <[email protected]>
Scaling drivers that implement the cpufreq_driver.setpolicy() versus the cpufreq_driver.target() interface do not set policy->cur.
Normally policy->cur is set during the call to cpufreq_driver.target() when the frequnecy request is made by the governor.
If the scaling driver implements cpufreq_driver.setpolicy() and cpufreq_driver.get() interfaces use cpufreq_driver.get() to retrieve the current frequency.
--- drivers/cpufreq/cpufreq.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
drivers/cpufreq/cpufreq.c +6 -1
@@ -1177,9 +1177,14 @@ static void cpufreq_out_of_sync(unsigned int cpu, unsigned int old_freq,*/ unsigned int cpufreq_quick_get (unsigned int cpu) { -struct cpufreq_policy *policy =cpufreq_cpu_get (cpu); +struct cpufreq_policy *policy;unsigned int ret_freq =0 ; +if (cpufreq_driver && cpufreq_driver->setpolicy && + cpufreq_driver->get) +return cpufreq_driver->get (cpu); + + policy =cpufreq_cpu_get (cpu);if (policy) { ret_freq = policy->cur;cpufreq_cpu_put (policy);
Signature · 1 line
1.7.7.6
Viresh Kumar
maintainerRe: [PATCH 1/5] cpufreq: Retrieve current frequency from scaling drivers with internal governors
Quoted 8 lines · On Wed, Feb 6, 2013 at 10:32 PM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
Scaling drivers that implement the
cpufreq_driver.setpolicy()versus thecpufreq_driver.target()interface do not setpolicy->cur.Normally
policy->curis set during the call tocpufreq_driver.target()when the frequnecy request is made by the governor.
Quoted 6 lines
If the scaling driver implements
cpufreq_driver.setpolicy()andcpufreq_driver.get()interfaces usecpufreq_driver.get()to retrieve the current frequency.Signed-off-by Dirk Brandewie <[email protected]>Acked-by Viresh Kumar <[email protected]>
To fix sparse warning updated this patch as:
commit f6060fa13ace2da4e691233706a788f91ad453da
Author: Viresh Kumar <[email protected]> Date: Thu Feb 7 19:12:16 2013 +0530
fixup! cpufreq: Retrieve current frequency from scaling drivers
with internal governors
--- drivers/cpufreq/cpufreq.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/cpufreq/cpufreq.c +0 -0
@@ -1173,12 +1173,12 @@ static void cpufreq_out_of_sync(unsigned int
cpu, unsigned int old_freq,
*/
unsigned int cpufreq_quick_get(unsigned int cpu)
{
+ struct cpufreq_driver *driver = rcu_dereference(cpufreq_driver);
struct cpufreq_policy *policy;
unsigned int ret_freq = 0;- if (cpufreq_driver && cpufreq_driver->setpolicy &&
- cpufreq_driver->get)
- return cpufreq_driver->get(cpu);
+ if (driver && driver->setpolicy && driver->get)
+ return driver->get(cpu);
policy = cpufreq_cpu_get(cpu);
if (policy) {PATCH 2/5 cpufreq: Only call cpufreq_out_of_sync() for driver that implement cpufreq_driver.target()
In reply to [email protected]From: Dirk Brandewie <[email protected]>
Scaling drivers that implement cpufreq_driver.setpolicy() have internal governors that do not signal changes via cpufreq_notify_transition() so the frequncy in the policy will almost certainly be different than the current frequncy. Only call cpufreq_out_of_sync() when the underlying driver implements cpufreq_driver.target()
--- drivers/cpufreq/cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/cpufreq/cpufreq.c +1 -1
@@ -1798,7 +1798,7 @@ int cpufreq_update_policy(unsigned int cpu)pr_debug ("Driver did not initialize current freq" ); data->cur = policy.cur; }else { -if (data->cur != policy.cur) +if (data->cur != policy.cur && driver->target)cpufreq_out_of_sync (cpu, data->cur, policy.cur); }
Signature · 1 line
1.7.7.6
PATCH 2/5 cpufreq: Only call cpufreq_out_of_sync() with drivers that implement cpufreq_driver.target()
In reply to [email protected]From: Dirk Brandewie <[email protected]>
Scaling drivers that implement cpufreq_driver.setpolicy() have internal governors that do not signal changes via cpufreq_notify_transition() so the frequncy in the policy will almost certainly be different than the current frequncy. Only call cpufreq_out_of_sync() when the underlying driver implements cpufreq_driver.target()
--- drivers/cpufreq/cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/cpufreq/cpufreq.c +1 -1
@@ -1798,7 +1798,7 @@ int cpufreq_update_policy(unsigned int cpu)pr_debug ("Driver did not initialize current freq" ); data->cur = policy.cur; }else { -if (data->cur != policy.cur) +if (data->cur != policy.cur && driver->target)cpufreq_out_of_sync (cpu, data->cur, policy.cur); }
Signature · 1 line
1.7.7.6
Viresh Kumar
maintainerRe: [PATCH 2/5] cpufreq: Only call cpufreq_out_of_sync() with drivers that implement cpufreq_driver.target()
Quoted 19 lines · On Wed, Feb 6, 2013 at 10:32 PM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
Scaling drivers that implement
cpufreq_driver.setpolicy()have internal governors that do not signal changes viacpufreq_notify_transition()so the frequncy in the policy will almost certainly be different than the current frequncy. Only callcpufreq_out_of_sync()when the underlying driver implementscpufreq_driver.target()Signed-off-by Dirk Brandewie <[email protected]>--- drivers/cpufreq/cpufreq.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/cpufreq/cpufreq.c +0
-0
drivers/cpufreq/cpufreq.c int cpufreq_update_policy(unsigned int cpu) · line 1803
Quoted 7 lines
drivers/cpufreq/cpufreq.c +1
-1@@ -1798,7 +1798,7 @@ int cpufreq_update_policy(unsigned int cpu)pr_debug ("Driver did not initialize current freq" ); data->cur = policy.cur; }else { -if (data->cur != policy.cur) +if (data->cur != policy.cur && driver->target)cpufreq_out_of_sync (cpu, data->cur, policy.cur);
Looks much better now :)
PATCH 3/5 cpufreq: Do not track governor name for scaling drivers with internal governors.
In reply to [email protected]From: Dirk Brandewie <[email protected]>
Scaling drivers that implement internal governors do not have governor structures assocaited with them. Only track the name of the governor associated with the CPU if the driver does not implement cpufreq_driver.setpolicy()
--- drivers/cpufreq/cpufreq.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/cpufreq/cpufreq.c +3 -1
@@ -1049,7 +1049,9 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif__cpufreq_governor (data,CPUFREQ_GOV_STOP );#ifdef CONFIG_HOTPLUG_CPU -strncpy (per_cpu (cpufreq_cpu_governor, cpu), data->governor->name, +if (!cpufreq_driver->setpolicy) +strncpy (per_cpu (cpufreq_cpu_governor, cpu), + data->governor->name,CPUFREQ_NAME_LEN );#endif
Signature · 1 line
1.7.7.6
Viresh Kumar
maintainerRe: [PATCH 3/5] cpufreq: Do not track governor name for scaling drivers with internal governors.
Quoted 18 lines · On Wed, Feb 6, 2013 at 10:32 PM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
Scaling drivers that implement internal governors do not have governor structures assocaited with them. Only track the name of the governor associated with the CPU if the driver does not implement
cpufreq_driver.setpolicy()Signed-off-by Dirk Brandewie <[email protected]>Acked-by Viresh Kumar <[email protected]>--- drivers/cpufreq/cpufreq.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)drivers/cpufreq/cpufreq.c +0
-0
drivers/cpufreq/cpufreq.c static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif · line 1055
Quoted 8 lines
drivers/cpufreq/cpufreq.c +3
-1@@ -1049,7 +1049,9 @@ static int __cpufreq_remove_dev(struct device *dev, struct subsys_interface *sif__cpufreq_governor (data,CPUFREQ_GOV_STOP );#ifdef CONFIG_HOTPLUG_CPU -strncpy (per_cpu (cpufreq_cpu_governor, cpu), data->governor->name, +if (!cpufreq_driver->setpolicy) +strncpy (per_cpu (cpufreq_cpu_governor, cpu), + data->governor->name,CPUFREQ_NAME_LEN );
While applying this patch in my repo, i have merged above two lines into a single line.
Viresh Kumar
maintainerRe: [PATCH 3/5] cpufreq: Do not track governor name for scaling drivers with internal governors.
In reply to [email protected]Quoted 9 lines · On Wed, Feb 6, 2013 at 10:32 PM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
Scaling drivers that implement internal governors do not have governor structures assocaited with them. Only track the name of the governor associated with the CPU if the driver does not implement
cpufreq_driver.setpolicy()Signed-off-by Dirk Brandewie <[email protected]>Acked-by Viresh Kumar <[email protected]>
To fix sparse warning updated this patch as:
commit ea241d95152c535c3d261f3a2240c45480b040bc
Author: Viresh Kumar <[email protected]> Date: Thu Feb 7 19:13:43 2013 +0530
fixup! cpufreq: Do not track governor name for scaling drivers
with internal governors.
--- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq.c +0 -0
@@ -1039,7 +1039,7 @@ static int __cpufreq_remove_dev(struct device
*dev, struct subsys_interface *sif
__cpufreq_governor(data, CPUFREQ_GOV_STOP);
#ifdef CONFIG_HOTPLUG_CPU
- if (!cpufreq_driver->setpolicy)
+ if (!driver->setpolicy)
strncpy(per_cpu(cpufreq_cpu_governor, cpu),
data->governor->name, CPUFREQ_NAME_LEN);#endif
PATCH 4/5 cpufreq_stats: do not remove sysfs files if frequency table is not present
In reply to [email protected]From: Dirk Brandewie <[email protected]>
The sysfs files for cpufreq_stats are created in cpufreq_stats_create_table() called from cpufreq_stat_notifier_policy() when a policy is added to the cpu. cpufreq_stats_create_table() will not be called if the scaling driver does not export a frequency table to cpufreq. Use the same fence on tear down.
--- drivers/cpufreq/cpufreq_stats.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/cpufreq/cpufreq_stats.c +4 -0
@@ -179,6 +179,10 @@ static void cpufreq_stats_free_table(unsigned int cpu)static void cpufreq_stats_free_sysfs (unsigned int cpu) {struct cpufreq_policy *policy =cpufreq_cpu_get (cpu); + +if (!cpufreq_frequency_get_table (cpu)) +return ; +if (policy && !policy_is_shared (policy)) {pr_debug ("%s: Free sysfs stat\n" , __func__);sysfs_remove_group (&policy->kobj, &stats_attr_group);
Signature · 1 line
1.7.7.6
PATCH 5/5 cpufreq/x86: Add P-state driver for sandy bridge.
In reply to [email protected]From: Dirk Brandewie <[email protected]>
Add a P-state driver for the Intel Sandy bridge processor. In cpufreq terminology this driver implements a scaling driver with an internal governor.
When built into the the kernel this driver will be the preferred scaling driver for Sandy bridge processors.
In addition to the interfaces provided by the cpufreq subsystem for controlling scaling drivers. The user may control the behavior of the driver via three sysfs files located in "/sys/devices/system/cpu/intel_pstate".
max_perf_pct: limits the maximum P state that will be requested by the driver stated as a percentage of the avail performance.
min_perf_pct: limits the minimum P state that will be requested by the driver stated as a percentage of the avail performance.
no_turbo: limits the driver to selecting P states below the turbo frequency range.
--- drivers/cpufreq/Kconfig.x86 | 18 + drivers/cpufreq/Makefile | 1 + drivers/cpufreq/intel_pstate.c | 829 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 848 insertions(+), 0 deletions(-) create mode 100644 drivers/cpufreq/intel_pstate.c
drivers/cpufreq/Kconfig.x86 +18 -0
@@ -2,6 +2,24 @@ # x86 CPU Frequency scaling drivers # +config X86_INTEL_PSTATE + tristate "Intel P state control" + depends on X86 + help + This driver provides a P state for Intel core processors. + The driver implements an internal governor and will become + the scaling driver and governor for Sandy bridge processors. + + When this driver is enabled it will become the perferred + scaling driver for Sandy bridge processors. + + Note: This driver should be built with the same settings as + the other scaling drivers configured into the system + (module/built-in) in order for the driver to register itself + as the scaling driver on the system. + + If in doubt, say N. + config X86_PCC_CPUFREQ tristate "Processor Clocking Control interface driver" depends on ACPI && ACPI_PROCESSOR
drivers/cpufreq/Makefile +1 -0
@@ -40,6 +40,7 @@ obj-$(CONFIG_X86_SPEEDSTEP_SMI) += speedstep-smi.o obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o obj-$(CONFIG_X86_CPUFREQ_NFORCE2) += cpufreq-nforce2.o +obj-$(CONFIG_X86_INTEL_PSTATE) += intel_pstate.o ################################################################################## # ARM SoC drivers
drivers/cpufreq/intel_pstate.c new file +829 -0
829 lines not on this page · raw message
Signature · 1 line
1.7.7.6
Viresh Kumar
maintainerRe: [PATCH 5/5] cpufreq/x86: Add P-state driver for sandy bridge.
Quoted 8 lines · On Wed, Feb 6, 2013 at 10:32 PM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
Add a P-state driver for the Intel Sandy bridge processor. In cpufreq terminology this driver implements a scaling driver with an internal governor.
When built into the the kernel this driver will be the preferred scaling driver for Sandy bridge processors.
I have got some sparse warning fixes + generic cleanup (formatting related).
From: Viresh Kumar <[email protected]>
Date: Thu, 7 Feb 2013 19:27:50 +0530
Subject: [PATCH] fixup! cpufreq/x86: Add P-state driver for sandy bridge.
--- drivers/cpufreq/intel_pstate.c | 65 ++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 44 deletions(-)
drivers/cpufreq/intel_pstate.c +1 -1
@@ -99,7 +99,7 @@ struct cpudata {struct sample samples[SAMPLE_COUNT ]; }; -struct cpudata **all_cpu_data; +static struct cpudata **all_cpu_data;struct pstate_adjust_policy {int sample_rate_ms;int deadband;
@@ -158,13 +158,12 @@ static inline void pid_d_gain_set(struct _pid
*pid, int percent)
pid->d_gain = div_fp(int_tofp(percent), int_tofp(100));
}
-static signed int pid_calc(struct _pid *pid, int busy) +static signed int pid_calc(struct _pid *pid, int busy)
{
signed int err, result;
int32_t pterm, dterm, fp_error;
int32_t integral_limit;
-
err = pid->setpoint - busy;
fp_error = int_tofp(err);
@@ -190,7 +189,6 @@ static signed int pid_calc(struct _pid *pid, int busy)
return (signed int)fp_toint(result);
}
-
static inline void intel_pstate_busy_pid_reset(struct cpudata *cpu) {
pid_p_gain_set(&cpu->pid, cpu->pstate_policy->p_gain_pct);
@@ -202,7 +200,6 @@ static inline void intel_pstate_busy_pid_reset(struct cpudata *cpu)
100,
cpu->pstate_policy->deadband,
0);
-
}
static inline void intel_pstate_idle_pid_reset(struct cpudata *cpu)
@@ -257,8 +254,8 @@ static struct pid_param pid_files[] = {
{NULL, NULL}
};
-struct dentry *debugfs_parent;
-void intel_pstate_debug_expose_params(void) +static struct dentry *debugfs_parent; +static void intel_pstate_debug_expose_params(void)
{
int i = 0;
@@ -271,7 +268,6 @@ void intel_pstate_debug_expose_params(void)
&fops_pid_param);
i++;
}
-
}
/************************** debugfs end ************************/
@@ -281,7 +277,7 @@ void intel_pstate_debug_expose_params(void)
static ssize_t show_##file_name \
(struct kobject *kobj, struct attribute *attr, char *buf) \
{ \
- return sprintf(buf, "%u\n", limits.object); \
+ return sprintf(buf, "%u\n", limits.object); \
}
static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,
@@ -292,7 +288,7 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b,
ret = sscanf(buf, "%u", &input);
if (ret != 1)
return -EINVAL;
- limits.no_turbo = clamp_t(int, input, 0 , 1);
+ limits.no_turbo = clamp_t(int, input, 0 , 1);
return count;
}
@@ -329,12 +325,10 @@ show_one(no_turbo, no_turbo);
show_one(max_perf_pct, max_perf_pct); show_one(min_perf_pct, min_perf_pct);
-
define_one_global_rw(no_turbo);
define_one_global_rw(max_perf_pct);
define_one_global_rw(min_perf_pct);
-
static struct attribute *intel_pstate_attributes[] = {
&no_turbo.attr,
&max_perf_pct.attr,
@@ -347,7 +341,7 @@ static struct attribute_group intel_pstate_attr_group = {
};
static struct kobject *intel_pstate_kobject;
-void intel_pstate_sysfs_expose_params(void) +static void intel_pstate_sysfs_expose_params(void)
{
int rc;
@@ -359,7 +353,6 @@ void intel_pstate_sysfs_expose_params(void)
BUG_ON(rc);
}
-
/************************** sysfs end ************************/
static int intel_pstate_min_pstate(void)
@@ -404,7 +397,6 @@ static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max)
cpu->pstate.min_pstate, max_perf);
}
-
static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) {
int max_perf, min_perf;
@@ -416,7 +408,6 @@ static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate)
if (pstate == cpu->pstate.current_pstate)
return;
-
#ifndef MODULE
trace_cpu_frequency(pstate * 100000, cpu->cpu);
#endif
@@ -448,14 +439,13 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu)
cpu->pstate.max_pstate = intel_pstate_max_pstate(); cpu->pstate.turbo_pstate = intel_pstate_turbo_pstate();
- /* goto max pstate so we don't slow up boot if we are built-in
- if we are a module we will take care of it during normal
- operation
- */
+ /*
+ * goto max pstate so we don't slow up boot if we are built-in if we are
+ * a module we will take care of it during normal operation
+ */
intel_pstate_set_pstate(cpu, cpu->pstate.max_pstate);
}
-
static inline void intel_pstate_calc_busy(struct cpudata *cpu,
struct sample *sample)
{
@@ -508,8 +498,7 @@ static inline int intel_pstate_sample(struct cpudata *cpu)
static inline void intel_pstate_set_sample_time(struct cpudata *cpu) {
- int sample_time;
- int delay;
+ int sample_time, delay;
sample_time = cpu->pstate_policy->sample_rate_ms; delay = msecs_to_jiffies(sample_time);
@@ -532,12 +521,11 @@ static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu)
int32_t busy_scaled;
int32_t core_busy, turbo_pstate, current_pstate;
- core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy);
- turbo_pstate = int_tofp(cpu->pstate.turbo_pstate);
+ core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy);
+ turbo_pstate = int_tofp(cpu->pstate.turbo_pstate);
current_pstate = int_tofp(cpu->pstate.current_pstate); busy_scaled = mul_fp(core_busy, div_fp(turbo_pstate, current_pstate));
-
return fp_toint(busy_scaled);
}
@@ -549,7 +537,7 @@ static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu)
int steps;
pid = &cpu->pid;
- busy_scaled = intel_pstate_get_scaled_busy(cpu);
+ busy_scaled = intel_pstate_get_scaled_busy(cpu);
ctl = pid_calc(pid, busy_scaled);
@@ -569,7 +557,7 @@ static inline void intel_pstate_adjust_idle_pstate(struct cpudata *cpu)
pid = &cpu->idle_pid;
- busy_scaled = intel_pstate_get_scaled_busy(cpu);
+ busy_scaled = intel_pstate_get_scaled_busy(cpu);
ctl = pid_calc(pid, 100 - busy_scaled);
@@ -586,11 +574,7 @@ static inline void intel_pstate_adjust_idle_pstate(struct cpudata *cpu)
static void intel_pstate_timer_func(unsigned long __data) {
struct cpudata *cpu = (struct cpudata *) __data;
- int idx;
-
-
- idx = intel_pstate_sample(cpu);
-
+ int idx = intel_pstate_sample(cpu);
if (!cpu->idle_mode)
intel_pstate_adjust_busy_pstate(cpu);
@@ -653,12 +637,12 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
add_timer_on(&cpu->timer, cpunum);
- pr_info("Intel pstate controlling: cpu %d\n", cpunum);
+ pr_info("Intel pstate controlling: cpu %d\n", cpunum);
return 0;
}
-unsigned int intel_pstate_get(unsigned int cpu_num)
+static unsigned int intel_pstate_get(unsigned int cpu_num)
{
struct sample *sample;
struct cpudata *cpu;
@@ -683,13 +667,10 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
limits.min_perf_pct = clamp_t(int, limits.min_perf_pct, 0 , 100); limits.min_perf = div_fp(int_tofp(limits.min_perf_pct), int_tofp(100));
-
limits.max_perf_pct = policy->max * 100 / policy->cpuinfo.max_freq; limits.max_perf_pct = clamp_t(int, limits.max_perf_pct, 0 , 100); limits.max_perf = div_fp(int_tofp(limits.max_perf_pct), int_tofp(100));
-
-
if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
limits.min_perf_pct = 100;
limits.min_perf = int_tofp(1);
@@ -765,12 +746,10 @@ static struct cpufreq_driver intel_pstate_driver = {
.owner = THIS_MODULE,
};
-
static void intel_pstate_exit(void)
{
int cpu;
-
sysfs_remove_group(intel_pstate_kobject,
&intel_pstate_attr_group);
debugfs_remove_recursive(debugfs_parent);
@@ -791,11 +770,11 @@ static void intel_pstate_exit(void)
put_online_cpus();
vfree(all_cpu_data);
}
+module_exit(intel_pstate_exit);
static int __init intel_pstate_init(void)
{
int rc = 0;
-
const struct x86_cpu_id *id;
id = x86_match_cpu(intel_pstate_cpu_ids);
@@ -820,10 +799,8 @@ out:
intel_pstate_exit();
return -ENODEV;
}
+device_initcall(intel_pstate_init);
MODULE_AUTHOR("Dirk Brandewie <[email protected]>"); MODULE_DESCRIPTION("'intel_pstate' - P state driver Intel Core processors"); MODULE_LICENSE("GPL");
-
-device_initcall(intel_pstate_init); -module_exit(intel_pstate_exit);
Quoted 9 lines · On Wed, Feb 6, 2013 at 10:32 PM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
This driver implements a scaling driver with an internal governor for Intel Core processors. The driver follows the same model as the Transmeta scaling driver (
longrun.c) and implements thesetpolicy()instead oftarget(). Scaling drivers that implementsetpolicy()are assmuned to implement internal governors by the cpufreq core. All the logic for selecting the current P state is contained within the driver no external governor is used by the cpufreq core.
Hi Dirk,
All look good now :)
@Rafael: I wasn't sure if these would apply over my patches without any conflicts and so i applied them in my repo. Added my Acked-by's and fixed a minor thing in one of the patches (as mentioned in the other mail).
You can pick these from: dirk-patches
http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/dirk-patches
Viresh Kumar
maintainerQuoted 7 lines · Viresh Kumar
@Rafael: I wasn't sure if these would apply over my patches without any conflicts and so i applied them in my repo. Added my Acked-by's and fixed a minor thing in one of the patches (as mentioned in the other mail).
You can pick these from: dirk-patches
http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/dirk-patches
Hi Rafael,
I have got few sparse fixes for these patches. Updated the branch, please pick it up again.
Quoted 5 lines · Viresh Kumar
Quoted 4 lines · Viresh Kumar
@Rafael: I wasn't sure if these would apply over my patches without any conflicts and so i applied them in my repo. Added my Acked-by's and fixed a minor thing in one of the patches (as mentioned in the other mail).
Quoted 8 lines
Quoted 3 lines
You can pick these from: dirk-patches
http://git.linaro.org/gitweb?p=people/vireshk/linux.git;a=shortlog;h=refs/heads/dirk-patches
Hi Rafael,
I have got few sparse fixes for these patches. Updated the branch, please pick it up again.
I haven't picked it up yet, so thanks a lot for that work!
Rafael
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Quoted 10 lines · On Wed, Feb 06, 2013 at 09:02:07AM -0800, [email protected] wrote:
From: Dirk Brandewie <[email protected]>
This driver implements a scaling driver with an internal governor for Intel Core processors. The driver follows the same model as the Transmeta scaling driver (
longrun.c) and implements thesetpolicy()instead oftarget(). Scaling drivers that implementsetpolicy()are assmuned to implement internal governors by the cpufreq core. All the logic for selecting the current P state is contained within the driver no external governor is used by the cpufreq core.
Quoted 3 lines
At the moment only Intel SandyBridge processors are supported. As testing on SandyBridge+ processors is completed support will be added to the driver.
Won't you also need to patch drivers/cpufreq/acpi-cpufreq.c to not load on the processors that you want this driver to run on ?
Dave
Hi Dave,
Quoted 7 lines · Dave Jones
On Wed, Feb 06, 2013 at 09:02:07AM -0800, [email protected] wrote:
Won't you also need to patch
drivers/cpufreq/acpi-cpufreq.cto not load on the processors that you want this driver to run on ?Dave
For the case where both are built-in the load order works my driver uses device_initcall() and acpi_cpufreq uses late_initcall().
For the case where both are a module (which I was sure I tested) you are right I will have to do something.
For now I propose to make my driver built-in only while I sort out the right solution for the module build. Does this seem reasonable to everyone?
--Dirk
Quoted 11 lines · Dirk Brandewie
Hi Dave,
Quoted 7 lines · Dave Jones
On Wed, Feb 06, 2013 at 09:02:07AM -0800, [email protected] wrote:
Won't you also need to patch
drivers/cpufreq/acpi-cpufreq.cto not load on the processors that you want this driver to run on ?Dave
Quoted 8 lines
For the case where both are built-in the load order works my driver uses
device_initcall()andacpi_cpufrequseslate_initcall().For the case where both are a module (which I was sure I tested) you are right I will have to do something.
For now I propose to make my driver built-in only while I sort out the right solution for the module build. Does this seem reasonable to everyone?
Well, I've been saying I think your driver should be non-modular from the start. :-)
May I ask for a kernel command line switch to prevent it from registering if the user doesn't actually want it, though, if it's going to be non-modular?
Rafael
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
PATCH 1/1 cpufreq/intel_pstate: Add kernel command line option disable intel_pstate.
From: Dirk Brandewie <[email protected]>
When intel_pstate is configured into the kernel it will become the perferred scaling driver for processors that is supports. Allow the user to override this by adding:
intel_pstate=disable
on the kernel command line.
--- Documentation/kernel-parameters.txt | 5 +++++ drivers/cpufreq/intel_pstate.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)
Documentation/kernel-parameters.txt +5 -0
@@ -1131,6 +1131,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. 0 disables intel_idle and fall back on acpi_idle. 1 to 6 specify maximum depth of C-state. + intel_pstate= [X86] + disable + Do not enable intel_pstate as the default + scaling driver for the supported processors + intremap= [X86-64, Intel-IOMMU] on enable Interrupt Remapping (default) off disable Interrupt Remapping
drivers/cpufreq/intel_pstate.c +16 -0
@@ -773,11 +773,16 @@ static void intel_pstate_exit(void) }module_exit (intel_pstate_exit); +static int no_load; +static int __init intel_pstate_init (void ) {int rc =0 ;const struct x86_cpu_id *id; +if (no_load) +return -ENODEV ; + id =x86_match_cpu (intel_pstate_cpu_ids);if (!id)return -ENODEV ;
@@ -802,6 +807,17 @@ out: }device_initcall (intel_pstate_init); +static int __init intel_pstate_setup (char *str) +{ +if (!str) +return -EINVAL ; + +if (!strcmp (str,"disable" )) + no_load =1 ; +return 0 ; +} +early_param ("intel_pstate" , intel_pstate_setup); +MODULE_AUTHOR ("Dirk Brandewie <[email protected]>" );MODULE_DESCRIPTION ("'intel_pstate' - P state driver Intel Core processors" );MODULE_LICENSE ("GPL" );
Signature · 1 line
1.7.7.6
Re: [PATCH] cpufreq/intel_pstate: Add kernel command line option disable intel_pstate.
Quoted 35 lines · On Thu, Feb 14, 2013 at 10:38 AM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
When
intel_pstateis configured into the kernel it will become the perferred scaling driver for processors that is supports. Allow the user to override this by adding:
intel_pstate=disable
on the kernel command line.Signed-off-by Dirk Brandewie <[email protected]>--- Documentation/kernel-parameters.txt | 5 +++++ drivers/cpufreq/intel_pstate.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)Documentation/kernel-parameters.txt +5
-0@@ -1131,6 +1131,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. 0 disables intel_idle and fall back on acpi_idle. 1 to 6 specify maximum depth of C-state. + intel_pstate= [X86] + disable + Do not enable intel_pstate as the default + scaling driver for the supported processors + intremap= [X86-64, Intel-IOMMU] on enable Interrupt Remapping (default) off disable Interrupt Remappingdrivers/cpufreq/intel_pstate.c +0
-0
drivers/cpufreq/intel_pstate.c static void intel_pstate_exit(void) · line 776
Quoted 4 lines
drivers/cpufreq/intel_pstate.c +1
-0@@ -773,11 +773,16 @@ static void intel_pstate_exit(void) }module_exit (intel_pstate_exit); +static int no_load;
Looks like you can use __initdata with it.
Thanks
Yinghai
Quoted 38 lines
drivers/cpufreq/intel_pstate.c +15
-1+static int __init intel_pstate_init (void ) {int rc =0 ;const struct x86_cpu_id *id; +if (no_load) +return -ENODEV ; + id =x86_match_cpu (intel_pstate_cpu_ids);if (!id)return -ENODEV ;@@ -802,6 +807,17 @@ out: }device_initcall (intel_pstate_init); +static int __init intel_pstate_setup (char *str) +{ +if (!str) +return -EINVAL ; + +if (!strcmp (str,"disable" )) + no_load =1 ; +return 0 ; +} +early_param ("intel_pstate" , intel_pstate_setup); +MODULE_AUTHOR ("Dirk Brandewie <[email protected]>" );MODULE_DESCRIPTION ("'intel_pstate' - P state driver Intel Core processors" );MODULE_LICENSE ("GPL" ); --1.7.7.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Viresh Kumar
maintainerRe: [PATCH] cpufreq/intel_pstate: Add kernel command line option disable intel_pstate.
In reply to [email protected]Quoted 4 lines · On Fri, Feb 15, 2013 at 12:08 AM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
When
intel_pstateis configured into the kernel it will become the perferred scaling driver for processors that is supports. Allow the
s/perferred/preferred
s/is/it
Quoted 48 lines
user to override this by adding:
intel_pstate=disable
on the kernel command line.Signed-off-by Dirk Brandewie <[email protected]>--- Documentation/kernel-parameters.txt | 5 +++++ drivers/cpufreq/intel_pstate.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)Documentation/kernel-parameters.txt +5
-0@@ -1131,6 +1131,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. 0 disables intel_idle and fall back on acpi_idle. 1 to 6 specify maximum depth of C-state. + intel_pstate= [X86] + disable + Do not enable intel_pstate as the default + scaling driver for the supported processors + intremap= [X86-64, Intel-IOMMU] on enable Interrupt Remapping (default) off disable Interrupt Remappingdrivers/cpufreq/intel_pstate.c +5
-0@@ -773,11 +773,16 @@ static void intel_pstate_exit(void) }module_exit (intel_pstate_exit); +static int no_load; +static int __init intel_pstate_init (void ) {int rc =0 ;const struct x86_cpu_id *id; +if (no_load) +return -ENODEV ; + id =x86_match_cpu (intel_pstate_cpu_ids);if (!id)return -ENODEV ;
drivers/cpufreq/intel_pstate.c out: · line 810
Quoted 4 lines
drivers/cpufreq/intel_pstate.c +1
-0@@ -802,6 +807,17 @@ out: }device_initcall (intel_pstate_init); +static int __init intel_pstate_setup (char *str)
Parameter to this is really not required. By default intel_pstate driver is enabled, so just past disable_intel_pstate from command line without any args.
Quoted 9 lines
drivers/cpufreq/intel_pstate.c +9
-0+{ +if (!str) +return -EINVAL ; + +if (!strcmp (str,"disable" )) + no_load =1 ; +return 0 ; +} +early_param ("intel_pstate" , intel_pstate_setup);
Re: [PATCH] cpufreq/intel_pstate: Add kernel command line option disable intel_pstate.
Quoted 61 lines · Viresh Kumar
Quoted 4 lines · On Fri, Feb 15, 2013 at 12:08 AM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
When
intel_pstateis configured into the kernel it will become the perferred scaling driver for processors that is supports. Allow thes/perferred/preferred
s/is/it
Quoted 51 lines
user to override this by adding:
intel_pstate=disable
on the kernel command line.Signed-off-by Dirk Brandewie <[email protected]>--- Documentation/kernel-parameters.txt | 5 +++++ drivers/cpufreq/intel_pstate.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)Documentation/kernel-parameters.txt +5
-0@@ -1131,6 +1131,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. 0 disables intel_idle and fall back on acpi_idle. 1 to 6 specify maximum depth of C-state. + intel_pstate= [X86] + disable + Do not enable intel_pstate as the default + scaling driver for the supported processors + intremap= [X86-64, Intel-IOMMU] on enable Interrupt Remapping (default) off disable Interrupt Remappingdrivers/cpufreq/intel_pstate.c +5
-0@@ -773,11 +773,16 @@ static void intel_pstate_exit(void) }module_exit (intel_pstate_exit); +static int no_load; +static int __init intel_pstate_init (void ) {int rc =0 ;const struct x86_cpu_id *id; +if (no_load) +return -ENODEV ; + id =x86_match_cpu (intel_pstate_cpu_ids);if (!id)return -ENODEV ;@@ -802,6 +807,17 @@ out: }device_initcall (intel_pstate_init);
Quoted 5 lines
drivers/cpufreq/intel_pstate.c out: · line 810
Quoted 1 line
drivers/cpufreq/intel_pstate.c +1
-0+static int __init intel_pstate_setup (char *str)Parameter to this is really not required. By default
intel_pstatedriver is enabled, so just pastdisable_intel_pstatefrom command line without any args.
Well, quite frankly, I'm fine with both. It all boils down to passing a specific string on the kernel command line.
Thanks,
Rafael
Quoted 9 lines
Quoted 9 lines
drivers/cpufreq/intel_pstate.c +9
-0+{ +if (!str) +return -EINVAL ; + +if (!strcmp (str,"disable" )) + no_load =1 ; +return 0 ; +} +early_param ("intel_pstate" , intel_pstate_setup);
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Viresh Kumar
maintainerRe: [PATCH] cpufreq/intel_pstate: Add kernel command line option disable intel_pstate.
Quoted 7 lines · Rafael J. Wysocki
Quoted 3 lines · Viresh Kumar
Parameter to this is really not required. By default
intel_pstatedriver is enabled, so just pastdisable_intel_pstatefrom command line without any args.Well, quite frankly, I'm fine with both. It all boils down to passing a specific string on the kernel command line.
Well, we are all looking to save worlds power here and my suggestion would definitely use less power as it has less instructions to execute. Just for fun!!.
Re: [PATCH] cpufreq/intel_pstate: Add kernel command line option disable intel_pstate.
Quoted 6 lines · Viresh Kumar
Quoted 5 lines · Rafael J. Wysocki
Quoted 3 lines · Viresh Kumar
Parameter to this is really not required. By default
intel_pstatedriver is enabled, so just pastdisable_intel_pstatefrom command line without any args.
Quoted 7 lines
Quoted 2 lines
Well, quite frankly, I'm fine with both. It all boils down to passing a specific string on the kernel command line.
Well, we are all looking to save worlds power here and my suggestion would definitely use less power as it has less instructions to execute. Just for fun!!.
I would like to leave it the way it is now. If for what ever reason we need another switch passed to the driver we have a place for it without adding another single purpose command line option
The updated with __initdata and the spelling fixes will follow shortly
--Dirk
PATCH 1/1 cpufreq/intel_pstate: Add kernel command line option disable intel_pstate.
In reply to Rafael J. WysockiFrom: Dirk Brandewie <[email protected]>
When intel_pstate is configured into the kernel it will become the preferred scaling driver for processors that it supports. Allow the user to override this by adding:
intel_pstate=disable
on the kernel command line.
--- Documentation/kernel-parameters.txt | 5 +++++ drivers/cpufreq/intel_pstate.c | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-)
Documentation/kernel-parameters.txt +5 -0
@@ -1131,6 +1131,11 @@ bytes respectively. Such letter suffixes can also be entirely omitted. 0 disables intel_idle and fall back on acpi_idle. 1 to 6 specify maximum depth of C-state. + intel_pstate= [X86] + disable + Do not enable intel_pstate as the default + scaling driver for the supported processors + intremap= [X86-64, Intel-IOMMU] on enable Interrupt Remapping (default) off disable Interrupt Remapping
drivers/cpufreq/intel_pstate.c +16 -0
@@ -773,11 +773,16 @@ static void intel_pstate_exit(void) }module_exit (intel_pstate_exit); +static int __initdata no_load; +static int __init intel_pstate_init (void ) {int rc =0 ;const struct x86_cpu_id *id; +if (no_load) +return -ENODEV ; + id =x86_match_cpu (intel_pstate_cpu_ids);if (!id)return -ENODEV ;
@@ -802,6 +807,17 @@ out: }device_initcall (intel_pstate_init); +static int __init intel_pstate_setup (char *str) +{ +if (!str) +return -EINVAL ; + +if (!strcmp (str,"disable" )) + no_load =1 ; +return 0 ; +} +early_param ("intel_pstate" , intel_pstate_setup); +MODULE_AUTHOR ("Dirk Brandewie <[email protected]>" );MODULE_DESCRIPTION ("'intel_pstate' - P state driver Intel Core processors" );MODULE_LICENSE ("GPL" );
Signature · 1 line
1.7.7.6
Viresh Kumar
maintainerQuoted 9 lines · Dirk Brandewie
For the case where both are built-in the load order works my driver uses
device_initcall()andacpi_cpufrequseslate_initcall().For the case where both are a module (which I was sure I tested) you are right
I will have to do something.For now I propose to make my driver built-in only while I sort out the right solution for the module build. Does this seem reasonable to everyone?
Of-course i am missing something here. Why would anybody want to insert acpi-cpufreq module when the system supports the pstate driver.
In case they are mutually exclusive, then we can have something like depends on !ACPI-DRIVER in the kconfig option of pstate driver.
Quoted 9 lines · Viresh Kumar
Quoted 7 lines · Dirk Brandewie
For the case where both are built-in the load order works my driver uses
device_initcall()andacpi_cpufrequseslate_initcall().For the case where both are a module (which I was sure I tested) you are right
I will have to do something.
Quoted 8 lines
Quoted 2 lines
For now I propose to make my driver built-in only while I sort out the right solution for the module build. Does this seem reasonable to everyone?
Of-course i am missing something here. Why would anybody want to insert acpi-cpufreq module when the system supports the pstate driver.
In case they are mutually exclusive, then we can have something like depends on !ACPI-DRIVER in the kconfig option of pstate driver.
Yes. Or the other way around (i.e. make acpi_cpufreq depend on !X86_INTEL_PSTATE).
Thanks,
Rafael
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
Quoted 13 lines · Rafael J. Wysocki
Quoted 12 lines · Viresh Kumar
Quoted 9 lines · Dirk Brandewie
For the case where both are built-in the load order works my driver uses
device_initcall()andacpi_cpufrequseslate_initcall().For the case where both are a module (which I was sure I tested) you are right
I will have to do something.For now I propose to make my driver built-in only while I sort out the right solution for the module build. Does this seem reasonable to everyone?
Quoted 9 lines
Quoted 5 lines
Of-course i am missing something here. Why would anybody want to insert acpi-cpufreq module when the system supports the pstate driver.
In case they are mutually exclusive, then we can have something like depends on !ACPI-DRIVER in the kconfig option of pstate driver.
Yes. Or the other way around (i.e. make
acpi_cpufreqdepend on !X86_INTEL_PSTATE).
The issue is that acpi-cpufreq still needs to be available for Intel processors before SandyBridge and for other x86 compatible processors we can't make intel_pstate and acpi-cpufreq mutually exclusive.
Having intel_pstate built-in solves the issue without the need to patch acpi-cpufreq. I believe that most distros build the scaling drivers in so the distro/user will make the explicit decision to use intel_pstate.
Quoted 4 lines
Thanks,
Rafael
Quoted 13 lines · Rafael J. Wysocki
Quoted 12 lines · Viresh Kumar
Quoted 9 lines · Dirk Brandewie
For the case where both are built-in the load order works my driver uses
device_initcall()andacpi_cpufrequseslate_initcall().For the case where both are a module (which I was sure I tested) you are right
I will have to do something.For now I propose to make my driver built-in only while I sort out the right solution for the module build. Does this seem reasonable to everyone?
Quoted 9 lines
Quoted 5 lines
Of-course i am missing something here. Why would anybody want to insert acpi-cpufreq module when the system supports the pstate driver.
In case they are mutually exclusive, then we can have something like depends on !ACPI-DRIVER in the kconfig option of pstate driver.
Yes. Or the other way around (i.e. make
acpi_cpufreqdepend on !X86_INTEL_PSTATE).
The issue is that acpi-cpufreq still needs to be available for Intel processors before SandyBridge and for other x86 compatible processors we can't make intel_pstate and acpi-cpufreq mutually exclusive.
Having intel_pstate built-in solves the issue without the need to patch acpi-cpufreq. I believe that most distros build the scaling drivers in so the distro/user will make the explicit decision to use intel_pstate.
Quoted 4 lines
Thanks,
Rafael
Quoted 20 lines · Dirk Brandewie
Quoted 19 lines · Rafael J. Wysocki
Quoted 17 lines · Viresh Kumar
Quoted 9 lines · Dirk Brandewie
For the case where both are built-in the load order works my driver uses
device_initcall()andacpi_cpufrequseslate_initcall().For the case where both are a module (which I was sure I tested) you are right
I will have to do something.For now I propose to make my driver built-in only while I sort out the right solution for the module build. Does this seem reasonable to everyone?
Of-course i am missing something here. Why would anybody want to insert acpi-cpufreq module when the system supports the pstate driver.
In case they are mutually exclusive, then we can have something like depends on !ACPI-DRIVER in the kconfig option of pstate driver.
Quoted 7 lines
Quoted 3 lines
Yes. Or the other way around (i.e. make
acpi_cpufreqdepend on !X86_INTEL_PSTATE).The issue is that acpi-cpufreq still needs to be available for Intel processors before SandyBridge and for other x86 compatible processors we can't make
intel_pstateand acpi-cpufreq mutually exclusive.
Right, I forgot about that and recalled it just a minute after sending that message.
Quoted 3 lines
Having
intel_pstatebuilt-in solves the issue without the need to patch acpi-cpufreq. I believe that most distros build the scaling drivers in so the distro/user will make the explicit decision to useintel_pstate.
But then we need to allow the user to choose acpi_cpufreq anyway if it's preferred whatever the reason.
Thanks,
Rafael
Signature · 2 lines
I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center.
PATCH 1/1 cpufreq/intel_pstate: Change to disallow module build
In reply to Dave JonesFrom: Dirk Brandewie <[email protected]>
Load order is important in order for intel_pstate to take over as the default scaling driver from acpi-cpufreq.
If both are built-in acpi-cpufreq uses late_initcall() and intel_pstate uses device_initcall() so it will be able to register as the scaling before acpi-cpufreq for the processors supported by intel_pstate.
If acpi-cpufreq is built as a module then intel_pstate still gets first option to become the scaling driver.
---
based on linux-pm/linux-next fe9e0a66
drivers/cpufreq/Kconfig.x86 | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/cpufreq/Kconfig.x86 +1 -6
@@ -3,7 +3,7 @@ # config X86_INTEL_PSTATE - tristate "Intel P state control" + bool "Intel P state control" depends on X86 help This driver provides a P state for Intel core processors.
@@ -13,11 +13,6 @@ config X86_INTEL_PSTATE When this driver is enabled it will become the perferred scaling driver for Sandy bridge processors. - Note: This driver should be built with the same settings as - the other scaling drivers configured into the system - (module/built-in) in order for the driver to register itself - as the scaling driver on the system. - If in doubt, say N. config X86_PCC_CPUFREQ
Signature · 1 line
1.7.7.6
PATCH 1/1 cpufreq/intel_pstate: Change to disallow module build
From: Dirk Brandewie <[email protected]>
Load order is important in order for intel_pstate to take over as the default scaling driver from acpi-cpufreq.
If both are built-in acpi-cpufreq uses late_initcall() and intel_pstate uses device_initcall() so it will be able to register as the scaling before acpi-cpufreq for the processors supported by intel_pstate.
If acpi-cpufreq is built as a module then intel_pstate still gets first option to become the scaling driver.
--- drivers/cpufreq/Kconfig.x86 | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
drivers/cpufreq/Kconfig.x86 +1 -6
@@ -3,7 +3,7 @@ # config X86_INTEL_PSTATE - tristate "Intel P state control" + bool "Intel P state control" depends on X86 help This driver provides a P state for Intel core processors.
@@ -13,11 +13,6 @@ config X86_INTEL_PSTATE When this driver is enabled it will become the perferred scaling driver for Sandy bridge processors. - Note: This driver should be built with the same settings as - the other scaling drivers configured into the system - (module/built-in) in order for the driver to register itself - as the scaling driver on the system. - If in doubt, say N. config X86_PCC_CPUFREQ
Signature · 1 line
1.7.7.6
Re: [PATCH] cpufreq/intel_pstate: Change to disallow module build
In reply to [email protected]Quoted 10 lines · On Thu, Feb 14, 2013 at 1:44 AM, <[email protected]> wrote:
From: Dirk Brandewie <[email protected]>
Load order is important in order for
intel_pstateto take over as the default scaling driver from acpi-cpufreq.If both are built-in acpi-cpufreq uses
late_initcall()andintel_pstateusesdevice_initcall()so it will be able to register as the scaling before acpi-cpufreq for the processors supported byintel_pstate.
Quoted 4 lines
If acpi-cpufreq is built as a module then
intel_pstatestill gets first option to become the scaling driver.Signed-off-by Dirk Brandewie <[email protected]>