Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67784
b: refs/heads/master
c: 6afde10
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Renninger authored and Dave Jones committed Oct 4, 2007
1 parent e3fbe00 commit a0f2e6f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1c2562459faedc35927546cfa5273ec6c2884cce
refs/heads/master: 6afde10c3f58cc3ac593f5b4505b8b1cf719f5d6
27 changes: 20 additions & 7 deletions trunk/drivers/cpufreq/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,17 +1484,30 @@ static int __cpufreq_governor(struct cpufreq_policy *policy,
unsigned int event)
{
int ret;
struct cpufreq_governor *gov = CPUFREQ_PERFORMANCE_GOVERNOR;

/* Only must be defined when default governor is known to have latency
restrictions, like e.g. conservative or ondemand.
That this is the case is already ensured in Kconfig
*/
#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE
struct cpufreq_governor *gov = &cpufreq_gov_performance;
#else
struct cpufreq_governor *gov = NULL;
#endif

if (policy->governor->max_transition_latency &&
policy->cpuinfo.transition_latency >
policy->governor->max_transition_latency) {
printk(KERN_WARNING "%s governor failed, too long"
" transition latency of HW, fallback"
" to %s governor\n",
policy->governor->name,
gov->name);
policy->governor = gov;
if (!gov)
return -EINVAL;
else {
printk(KERN_WARNING "%s governor failed, too long"
" transition latency of HW, fallback"
" to %s governor\n",
policy->governor->name,
gov->name);
policy->governor = gov;
}
}

if (!try_module_get(policy->governor->owner))
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/cpufreq.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,9 @@ static inline unsigned int cpufreq_quick_get(unsigned int cpu)
Performance governor is fallback governor if any other gov failed to
auto load due latency restrictions
*/
#ifdef CONFIG_CPU_FREQ_GOV_PERFORMANCE
extern struct cpufreq_governor cpufreq_gov_performance;
#define CPUFREQ_PERFORMANCE_GOVERNOR (&cpufreq_gov_performance)
#endif
#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
#define CPUFREQ_DEFAULT_GOVERNOR (&cpufreq_gov_performance)
#elif defined(CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE)
Expand Down

0 comments on commit a0f2e6f

Please sign in to comment.