diff options
author | Len Brown <len.brown@intel.com> | 2010-07-23 16:04:46 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-07-23 16:04:46 -0400 |
commit | 0394c6676e3fa48587fbe4821390d3264672c530 (patch) | |
tree | 68b4a83288aeeaacec0f94d8fe90ecedbc4fb2f3 /drivers/idle | |
parent | c4236282e5921a410e8f074fec795b6ca0af36d5 (diff) |
intel_idle: delete power_policy modparam, and choose substate functions
The idea behind power policy was that it would start off as a modparam,
and then hook into the new "global" in-kernel power vs energy tunable.
But that tunable isn't happening, so delete the hook here.
With the policy hook gone, the sub-state choice functions
do not do anything useful, so delete them from the critical path.
To handle sub-states in the future, we will advertise them
with dedicated cpuidle_state entries. That is necessary
because some of the sub-states will have substantially different
properties than their peer sub-states.
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/idle')
-rwxr-xr-x | drivers/idle/intel_idle.c | 43 |
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 */ |
79 | static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1; | 79 | static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1; |
80 | static int power_policy = 7; /* 0 = max perf; 15 = max powersave */ | ||
81 | 80 | ||
82 | static unsigned int mwait_substates; | 81 | static unsigned int mwait_substates; |
83 | static 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. */ |
86 | static unsigned int lapic_timer_reliable_states; | 84 | static 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 | */ | ||
179 | static 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 | */ | ||
202 | static 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) | |||
447 | module_init(intel_idle_init); | 405 | module_init(intel_idle_init); |
448 | module_exit(intel_idle_exit); | 406 | module_exit(intel_idle_exit); |
449 | 407 | ||
450 | module_param(power_policy, int, 0644); | ||
451 | module_param(max_cstate, int, 0444); | 408 | module_param(max_cstate, int, 0444); |
452 | 409 | ||
453 | MODULE_AUTHOR("Len Brown <len.brown@intel.com>"); | 410 | MODULE_AUTHOR("Len Brown <len.brown@intel.com>"); |