aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/pseries/processor_idle.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
index 02e425aa2af8..a32d56d1f854 100644
--- a/arch/powerpc/platforms/pseries/processor_idle.c
+++ b/arch/powerpc/platforms/pseries/processor_idle.c
@@ -33,13 +33,6 @@ static int max_idle_state = MAX_IDLE_STATE_COUNT - 1;
33static struct cpuidle_device __percpu *pseries_cpuidle_devices; 33static struct cpuidle_device __percpu *pseries_cpuidle_devices;
34static struct cpuidle_state *cpuidle_state_table; 34static struct cpuidle_state *cpuidle_state_table;
35 35
36void update_smt_snooze_delay(int snooze)
37{
38 struct cpuidle_driver *drv = cpuidle_get_driver();
39 if (drv)
40 drv->states[0].target_residency = snooze;
41}
42
43static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before) 36static inline void idle_loop_prolog(unsigned long *in_purr, ktime_t *kt_before)
44{ 37{
45 38
@@ -190,6 +183,23 @@ static struct cpuidle_state shared_states[MAX_IDLE_STATE_COUNT] = {
190 .enter = &shared_cede_loop }, 183 .enter = &shared_cede_loop },
191}; 184};
192 185
186void update_smt_snooze_delay(int cpu, int residency)
187{
188 struct cpuidle_driver *drv = cpuidle_get_driver();
189 struct cpuidle_device *dev = per_cpu(cpuidle_devices, cpu);
190
191 if (cpuidle_state_table != dedicated_states)
192 return;
193
194 if (residency < 0) {
195 /* Disable the Nap state on that cpu */
196 if (dev)
197 dev->states_usage[1].disable = 1;
198 } else
199 if (drv)
200 drv->states[0].target_residency = residency;
201}
202
193static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n, 203static int pseries_cpuidle_add_cpu_notifier(struct notifier_block *n,
194 unsigned long action, void *hcpu) 204 unsigned long action, void *hcpu)
195{ 205{