Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc: Estimate G5 cpufreq transition latency

Setting G5's cpu frequency transition latency to CPUFREQ_ETERNAL stops
ondemand governor from working. I measured the latency using sched_clock
and haven't seen much higher than 11000ns, so I set this to 12000ns for
my configuration. Possibly other configurations will be different?
Ideally the generic code would be able to measure it in case the platform
does not provide it.

But this simple patch at least makes it throttle again.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

authored by

Nick Piggin and committed by
Benjamin Herrenschmidt
16962e7c e14eee56

+4 -1
+4 -1
arch/powerpc/platforms/powermac/cpufreq_64.c
··· 86 86 87 87 static DEFINE_MUTEX(g5_switch_mutex); 88 88 89 + static unsigned long transition_latency; 89 90 90 91 #ifdef CONFIG_PMAC_SMU 91 92 ··· 358 357 359 358 static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) 360 359 { 361 - policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; 360 + policy->cpuinfo.transition_latency = transition_latency; 362 361 policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; 363 362 /* secondary CPUs are tied to the primary one by the 364 363 * cpufreq core if in the secondary policy we tell it that ··· 501 500 g5_cpu_freqs[1].frequency = max_freq/2; 502 501 503 502 /* Set callbacks */ 503 + transition_latency = 12000; 504 504 g5_switch_freq = g5_scom_switch_freq; 505 505 g5_query_freq = g5_scom_query_freq; 506 506 freq_method = "SCOM"; ··· 677 675 g5_cpu_freqs[1].frequency = min_freq; 678 676 679 677 /* Set callbacks */ 678 + transition_latency = CPUFREQ_ETERNAL; 680 679 g5_switch_volt = g5_pfunc_switch_volt; 681 680 g5_switch_freq = g5_pfunc_switch_freq; 682 681 g5_query_freq = g5_pfunc_query_freq;