aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2007-10-02 16:28:12 -0400
committerDave Jones <davej@redhat.com>2007-10-04 18:40:57 -0400
commit1c2562459faedc35927546cfa5273ec6c2884cce (patch)
treea6133aa5c0ac2b4a8cb12fa37c28e755a458aef0 /include/linux/cpufreq.h
parent8122c6cea033e8034e99d3b10a4e3f377ce23994 (diff)
[CPUFREQ] allow ondemand and conservative cpufreq governors to be used as default
Depending on the transition latency of the HW for cpufreq switches, the ondemand or conservative governor cannot be used with certain cpufreq drivers. Still the ondemand should be the default governor on a wide range of systems. This patch allows this and lets the governor fallback to the performance governor at cpufreq driver load time, if the driver does not support fast enough frequency switching. Main benefit is that on e.g. installation or other systems without userspace support a working dynamic cpufreq support can be achieved on most systems by simply loading the cpufreq driver. This is especially essential for recent x86(_64) laptop hardware which may rely on working dynamic cpufreq OS support. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Cc: Russell King <rmk@arm.linux.org.uk> Cc: Bryan Wu <bryan.wu@analog.com> Cc: Andi Kleen <ak@suse.de> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 3ec6e7ff5fbd..9e5f5d0c87f3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -155,6 +155,9 @@ struct cpufreq_governor {
155 char name[CPUFREQ_NAME_LEN]; 155 char name[CPUFREQ_NAME_LEN];
156 int (*governor) (struct cpufreq_policy *policy, 156 int (*governor) (struct cpufreq_policy *policy,
157 unsigned int event); 157 unsigned int event);
158 unsigned int max_transition_latency; /* HW must be able to switch to
159 next freq faster than this value in nano secs or we
160 will fallback to performance governor */
158 struct list_head governor_list; 161 struct list_head governor_list;
159 struct module *owner; 162 struct module *owner;
160}; 163};
@@ -279,12 +282,23 @@ static inline unsigned int cpufreq_quick_get(unsigned int cpu)
279 *********************************************************************/ 282 *********************************************************************/
280 283
281 284
282#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE 285/*
286 Performance governor is fallback governor if any other gov failed to
287 auto load due latency restrictions
288*/
283extern struct cpufreq_governor cpufreq_gov_performance; 289extern struct cpufreq_governor cpufreq_gov_performance;
284#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_performance 290#define CPUFREQ_PERFORMANCE_GOVERNOR (&cpufreq_gov_performance)
291#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
292#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance)
285#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE) 293#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE)
286extern struct cpufreq_governor cpufreq_gov_userspace; 294extern struct cpufreq_governor cpufreq_gov_userspace;
287#define CPUFREQ_DEFAULT_GOVERNOR &cpufreq_gov_userspace 295#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_userspace)
296#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND)
297extern struct cpufreq_governor cpufreq_gov_ondemand;
298#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_ondemand)
299#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE)
300extern struct cpufreq_governor cpufreq_gov_conservative;
301#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_conservative)
288#endif 302#endif
289 303
290 304