Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45920
b: refs/heads/master
c: 5225cd8
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Pisa authored and Russell King committed Jan 24, 2007
1 parent ada8b72 commit 4482e2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 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: 3ea163e44c041b9e1d7314998dfbfd4fbc6eea20
refs/heads/master: 5225cd8079484ed27cd52040e8584616d1ef1e2c
14 changes: 13 additions & 1 deletion trunk/arch/arm/mach-imx/cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,17 @@ static int imx_set_target(struct cpufreq_policy *policy,
long sysclk;
unsigned int bclk_div = 1;

/*
* Some governors do not respects CPU and policy lower limits
* which leads to bad things (division by zero etc), ensure
* that such things do not happen.
*/
if(target_freq < policy->cpuinfo.min_freq)
target_freq = policy->cpuinfo.min_freq;

if(target_freq < policy->min)
target_freq = policy->min;

freq = target_freq * 1000;

pr_debug(KERN_DEBUG "imx: requested frequency %ld Hz, mpctl0 at boot 0x%08x\n",
Expand Down Expand Up @@ -258,7 +269,8 @@ static int __init imx_cpufreq_driver_init(struct cpufreq_policy *policy)
policy->governor = CPUFREQ_DEFAULT_GOVERNOR;
policy->cpuinfo.min_freq = 8000;
policy->cpuinfo.max_freq = 200000;
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
/* Manual states, that PLL stabilizes in two CLK32 periods */
policy->cpuinfo.transition_latency = 4 * 1000000000LL / CLK32;
return 0;
}

Expand Down

0 comments on commit 4482e2f

Please sign in to comment.