Commit dcb14337 authored by Shilpasri G Bhat's avatar Shilpasri G Bhat Committed by Michael Ellerman

cpufreq: powernv: Remove global pstate ramp-down timer in POWER9

POWER9 does not support global pstate requests for the chip. So remove
the timer logic which slowly ramps down the global pstate in P9
platforms.
Signed-off-by: default avatarShilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
[mpe: Drop NULL check before kfree(policy->driver_data)]
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 26064848
...@@ -758,8 +758,13 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy, ...@@ -758,8 +758,13 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
cur_msec = jiffies_to_msecs(get_jiffies_64()); cur_msec = jiffies_to_msecs(get_jiffies_64());
spin_lock(&gpstates->gpstate_lock);
freq_data.pstate_id = idx_to_pstate(new_index); freq_data.pstate_id = idx_to_pstate(new_index);
if (!gpstates) {
freq_data.gpstate_id = freq_data.pstate_id;
goto no_gpstate;
}
spin_lock(&gpstates->gpstate_lock);
if (!gpstates->last_sampled_time) { if (!gpstates->last_sampled_time) {
gpstate_idx = new_index; gpstate_idx = new_index;
...@@ -809,6 +814,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy, ...@@ -809,6 +814,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
spin_unlock(&gpstates->gpstate_lock); spin_unlock(&gpstates->gpstate_lock);
no_gpstate:
/* /*
* Use smp_call_function to send IPI and execute the * Use smp_call_function to send IPI and execute the
* mtspr on target CPU. We could do that without IPI * mtspr on target CPU. We could do that without IPI
...@@ -843,6 +849,13 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -843,6 +849,13 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
kernfs_put(kn); kernfs_put(kn);
} }
policy->freq_table = powernv_freqs;
policy->fast_switch_possible = true;
if (pvr_version_is(PVR_POWER9))
return 0;
/* Initialise Gpstate ramp-down timer only on POWER8 */
gpstates = kzalloc(sizeof(*gpstates), GFP_KERNEL); gpstates = kzalloc(sizeof(*gpstates), GFP_KERNEL);
if (!gpstates) if (!gpstates)
return -ENOMEM; return -ENOMEM;
...@@ -857,8 +870,6 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) ...@@ -857,8 +870,6 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy)
msecs_to_jiffies(GPSTATE_TIMER_INTERVAL); msecs_to_jiffies(GPSTATE_TIMER_INTERVAL);
spin_lock_init(&gpstates->gpstate_lock); spin_lock_init(&gpstates->gpstate_lock);
policy->freq_table = powernv_freqs;
policy->fast_switch_possible = true;
return 0; return 0;
} }
...@@ -998,6 +1009,7 @@ static void powernv_cpufreq_stop_cpu(struct cpufreq_policy *policy) ...@@ -998,6 +1009,7 @@ static void powernv_cpufreq_stop_cpu(struct cpufreq_policy *policy)
freq_data.pstate_id = idx_to_pstate(powernv_pstate_info.min); freq_data.pstate_id = idx_to_pstate(powernv_pstate_info.min);
freq_data.gpstate_id = idx_to_pstate(powernv_pstate_info.min); freq_data.gpstate_id = idx_to_pstate(powernv_pstate_info.min);
smp_call_function_single(policy->cpu, set_pstate, &freq_data, 1); smp_call_function_single(policy->cpu, set_pstate, &freq_data, 1);
if (gpstates)
del_timer_sync(&gpstates->timer); del_timer_sync(&gpstates->timer);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment