提交 16962e7c 编写于 作者: N Nick Piggin 提交者: Benjamin Herrenschmidt

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: NNick Piggin <npiggin@suse.de>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 e14eee56
...@@ -86,6 +86,7 @@ static int (*g5_query_freq)(void); ...@@ -86,6 +86,7 @@ static int (*g5_query_freq)(void);
static DEFINE_MUTEX(g5_switch_mutex); static DEFINE_MUTEX(g5_switch_mutex);
static unsigned long transition_latency;
#ifdef CONFIG_PMAC_SMU #ifdef CONFIG_PMAC_SMU
...@@ -357,7 +358,7 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu) ...@@ -357,7 +358,7 @@ static unsigned int g5_cpufreq_get_speed(unsigned int cpu)
static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy) static int g5_cpufreq_cpu_init(struct cpufreq_policy *policy)
{ {
policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cpuinfo.transition_latency = transition_latency;
policy->cur = g5_cpu_freqs[g5_query_freq()].frequency; policy->cur = g5_cpu_freqs[g5_query_freq()].frequency;
/* secondary CPUs are tied to the primary one by the /* secondary CPUs are tied to the primary one by the
* cpufreq core if in the secondary policy we tell it that * cpufreq core if in the secondary policy we tell it that
...@@ -500,6 +501,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus) ...@@ -500,6 +501,7 @@ static int __init g5_neo2_cpufreq_init(struct device_node *cpus)
g5_cpu_freqs[1].frequency = max_freq/2; g5_cpu_freqs[1].frequency = max_freq/2;
/* Set callbacks */ /* Set callbacks */
transition_latency = 12000;
g5_switch_freq = g5_scom_switch_freq; g5_switch_freq = g5_scom_switch_freq;
g5_query_freq = g5_scom_query_freq; g5_query_freq = g5_scom_query_freq;
freq_method = "SCOM"; freq_method = "SCOM";
...@@ -675,6 +677,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus) ...@@ -675,6 +677,7 @@ static int __init g5_pm72_cpufreq_init(struct device_node *cpus)
g5_cpu_freqs[1].frequency = min_freq; g5_cpu_freqs[1].frequency = min_freq;
/* Set callbacks */ /* Set callbacks */
transition_latency = CPUFREQ_ETERNAL;
g5_switch_volt = g5_pfunc_switch_volt; g5_switch_volt = g5_pfunc_switch_volt;
g5_switch_freq = g5_pfunc_switch_freq; g5_switch_freq = g5_pfunc_switch_freq;
g5_query_freq = g5_pfunc_query_freq; g5_query_freq = g5_pfunc_query_freq;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册