From 459fc208abd1b365fa013c17d433dfb5b4bc1e3a Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Thu, 16 Oct 2008 00:11:04 +0200 Subject: cpufreq: remove policy->governor setting in drivers initialization As policy->governor is already set to CPUFREQ_DEFAULT_GOVERNOR in the (always built-in) cpufreq core, we do not need to set it in the drivers. This fixes the sparc64 allmodconfig build failure. Also, remove a totally useles setting of ->policy in cpufreq-pxa3xx.c. Signed-off-by: Dominik Brodowski Acked-by: David S. Miller Signed-off-by: Linus Torvalds --- arch/avr32/mach-at32ap/cpufreq.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/avr32/mach-at32ap/cpufreq.c') diff --git a/arch/avr32/mach-at32ap/cpufreq.c b/arch/avr32/mach-at32ap/cpufreq.c index 5dd8d25428bf..d84efe4984ab 100644 --- a/arch/avr32/mach-at32ap/cpufreq.c +++ b/arch/avr32/mach-at32ap/cpufreq.c @@ -87,7 +87,6 @@ static int __init at32_cpufreq_driver_init(struct cpufreq_policy *policy) policy->cur = at32_get_speed(0); policy->min = policy->cpuinfo.min_freq; policy->max = policy->cpuinfo.max_freq; - policy->governor = CPUFREQ_DEFAULT_GOVERNOR; printk("cpufreq: AT32AP CPU frequency driver\n"); -- cgit v1.2.3 From e3f91ca48162c3eb70450314a4d09384fccb92fa Mon Sep 17 00:00:00 2001 From: Haavard Skinnemoen Date: Thu, 23 Oct 2008 11:23:08 +0200 Subject: avr32: Scale loops_per_jiffy when cpu frequency changes The loops_per_jiffy variable isn't updated when cpufreq changes the CPU frequency. This could cause udelay() and friends to produce wrong delays. Signed-off-by: Haavard Skinnemoen --- arch/avr32/mach-at32ap/cpufreq.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arch/avr32/mach-at32ap/cpufreq.c') diff --git a/arch/avr32/mach-at32ap/cpufreq.c b/arch/avr32/mach-at32ap/cpufreq.c index d84efe4984ab..024c586e936c 100644 --- a/arch/avr32/mach-at32ap/cpufreq.c +++ b/arch/avr32/mach-at32ap/cpufreq.c @@ -40,6 +40,9 @@ static unsigned int at32_get_speed(unsigned int cpu) return (unsigned int)((clk_get_rate(cpuclk) + 500) / 1000); } +static unsigned int ref_freq; +static unsigned long loops_per_jiffy_ref; + static int at32_set_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -61,8 +64,19 @@ static int at32_set_target(struct cpufreq_policy *policy, freqs.cpu = 0; freqs.flags = 0; + if (!ref_freq) { + ref_freq = freqs.old; + loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy; + } + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + if (freqs.old < freqs.new) + boot_cpu_data.loops_per_jiffy = cpufreq_scale( + loops_per_jiffy_ref, ref_freq, freqs.new); clk_set_rate(cpuclk, freq); + if (freqs.new < freqs.old) + boot_cpu_data.loops_per_jiffy = cpufreq_scale( + loops_per_jiffy_ref, ref_freq, freqs.new); cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); pr_debug("cpufreq: set frequency %lu Hz\n", freq); -- cgit v1.2.3