aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/idle/intel_idle.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 82c9a58b3ab0..6d43bc3b9e4f 100755
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -77,10 +77,8 @@ static struct cpuidle_driver intel_idle_driver = {
77}; 77};
78/* intel_idle.max_cstate=0 disables driver */ 78/* intel_idle.max_cstate=0 disables driver */
79static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1; 79static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1;
80static int power_policy = 7; /* 0 = max perf; 15 = max powersave */
81 80
82static unsigned int mwait_substates; 81static unsigned int mwait_substates;
83static int (*choose_substate)(int);
84 82
85/* Reliable LAPIC Timer States, bit 1 for C1 etc. */ 83/* Reliable LAPIC Timer States, bit 1 for C1 etc. */
86static unsigned int lapic_timer_reliable_states; 84static unsigned int lapic_timer_reliable_states;
@@ -168,42 +166,6 @@ static struct cpuidle_state atom_cstates[MWAIT_MAX_NUM_CSTATES] = {
168 .enter = NULL }, /* disabled */ 166 .enter = NULL }, /* disabled */
169}; 167};
170 168
171/*
172 * choose_tunable_substate()
173 *
174 * Run-time decision on which C-state substate to invoke
175 * If power_policy = 0, choose shallowest substate (0)
176 * If power_policy = 15, choose deepest substate
177 * If power_policy = middle, choose middle substate etc.
178 */
179static int choose_tunable_substate(int cstate)
180{
181 unsigned int num_substates;
182 unsigned int substate_choice;
183
184 power_policy &= 0xF; /* valid range: 0-15 */
185 cstate &= 7; /* valid range: 0-7 */
186
187 num_substates = (mwait_substates >> ((cstate) * 4))
188 & MWAIT_SUBSTATE_MASK;
189
190 if (num_substates <= 1)
191 return 0;
192
193 substate_choice = ((power_policy + (power_policy + 1) *
194 (num_substates - 1)) / 16);
195
196 return substate_choice;
197}
198
199/*
200 * choose_zero_substate()
201 */
202static int choose_zero_substate(int cstate)
203{
204 return 0;
205}
206
207/** 169/**
208 * intel_idle 170 * intel_idle
209 * @dev: cpuidle_device 171 * @dev: cpuidle_device
@@ -221,8 +183,6 @@ static int intel_idle(struct cpuidle_device *dev, struct cpuidle_state *state)
221 183
222 cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1; 184 cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
223 185
224 eax = eax + (choose_substate)(cstate);
225
226 local_irq_disable(); 186 local_irq_disable();
227 187
228 if (!(lapic_timer_reliable_states & (1 << (cstate)))) 188 if (!(lapic_timer_reliable_states & (1 << (cstate))))
@@ -301,13 +261,11 @@ static int intel_idle_probe(void)
301 case 0x25: /* Westmere */ 261 case 0x25: /* Westmere */
302 case 0x2C: /* Westmere */ 262 case 0x2C: /* Westmere */
303 cpuidle_state_table = nehalem_cstates; 263 cpuidle_state_table = nehalem_cstates;
304 choose_substate = choose_tunable_substate;
305 break; 264 break;
306 265
307 case 0x1C: /* 28 - Atom Processor */ 266 case 0x1C: /* 28 - Atom Processor */
308 lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */ 267 lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
309 cpuidle_state_table = atom_cstates; 268 cpuidle_state_table = atom_cstates;
310 choose_substate = choose_zero_substate;
311 break; 269 break;
312#ifdef FUTURE_USE 270#ifdef FUTURE_USE
313 case 0x17: /* 23 - Core 2 Duo */ 271 case 0x17: /* 23 - Core 2 Duo */
@@ -447,7 +405,6 @@ static void __exit intel_idle_exit(void)
447module_init(intel_idle_init); 405module_init(intel_idle_init);
448module_exit(intel_idle_exit); 406module_exit(intel_idle_exit);
449 407
450module_param(power_policy, int, 0644);
451module_param(max_cstate, int, 0444); 408module_param(max_cstate, int, 0444);
452 409
453MODULE_AUTHOR("Len Brown <len.brown@intel.com>"); 410MODULE_AUTHOR("Len Brown <len.brown@intel.com>");