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>

Len Brown 0394c667 c4236282

-43
-43
drivers/idle/intel_idle.c
··· 77 }; 78 /* intel_idle.max_cstate=0 disables driver */ 79 static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1; 80 - static int power_policy = 7; /* 0 = max perf; 15 = max powersave */ 81 82 static unsigned int mwait_substates; 83 - static int (*choose_substate)(int); 84 85 /* Reliable LAPIC Timer States, bit 1 for C1 etc. */ 86 static unsigned int lapic_timer_reliable_states; ··· 166 .enter = NULL }, /* disabled */ 167 }; 168 169 - /* 170 - * choose_tunable_substate() 171 - * 172 - * Run-time decision on which C-state substate to invoke 173 - * If power_policy = 0, choose shallowest substate (0) 174 - * If power_policy = 15, choose deepest substate 175 - * If power_policy = middle, choose middle substate etc. 176 - */ 177 - static int choose_tunable_substate(int cstate) 178 - { 179 - unsigned int num_substates; 180 - unsigned int substate_choice; 181 - 182 - power_policy &= 0xF; /* valid range: 0-15 */ 183 - cstate &= 7; /* valid range: 0-7 */ 184 - 185 - num_substates = (mwait_substates >> ((cstate) * 4)) 186 - & MWAIT_SUBSTATE_MASK; 187 - 188 - if (num_substates <= 1) 189 - return 0; 190 - 191 - substate_choice = ((power_policy + (power_policy + 1) * 192 - (num_substates - 1)) / 16); 193 - 194 - return substate_choice; 195 - } 196 - 197 - /* 198 - * choose_zero_substate() 199 - */ 200 - static int choose_zero_substate(int cstate) 201 - { 202 - return 0; 203 - } 204 - 205 /** 206 * intel_idle 207 * @dev: cpuidle_device ··· 182 int cpu = smp_processor_id(); 183 184 cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1; 185 - 186 - eax = eax + (choose_substate)(cstate); 187 188 local_irq_disable(); 189 ··· 261 case 0x25: /* Westmere */ 262 case 0x2C: /* Westmere */ 263 cpuidle_state_table = nehalem_cstates; 264 - choose_substate = choose_tunable_substate; 265 break; 266 267 case 0x1C: /* 28 - Atom Processor */ 268 lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */ 269 cpuidle_state_table = atom_cstates; 270 - choose_substate = choose_zero_substate; 271 break; 272 #ifdef FUTURE_USE 273 case 0x17: /* 23 - Core 2 Duo */ ··· 405 module_init(intel_idle_init); 406 module_exit(intel_idle_exit); 407 408 - module_param(power_policy, int, 0644); 409 module_param(max_cstate, int, 0444); 410 411 MODULE_AUTHOR("Len Brown <len.brown@intel.com>");
··· 77 }; 78 /* intel_idle.max_cstate=0 disables driver */ 79 static int max_cstate = MWAIT_MAX_NUM_CSTATES - 1; 80 81 static unsigned int mwait_substates; 82 83 /* Reliable LAPIC Timer States, bit 1 for C1 etc. */ 84 static unsigned int lapic_timer_reliable_states; ··· 168 .enter = NULL }, /* disabled */ 169 }; 170 171 /** 172 * intel_idle 173 * @dev: cpuidle_device ··· 220 int cpu = smp_processor_id(); 221 222 cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1; 223 224 local_irq_disable(); 225 ··· 301 case 0x25: /* Westmere */ 302 case 0x2C: /* Westmere */ 303 cpuidle_state_table = nehalem_cstates; 304 break; 305 306 case 0x1C: /* 28 - Atom Processor */ 307 lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */ 308 cpuidle_state_table = atom_cstates; 309 break; 310 #ifdef FUTURE_USE 311 case 0x17: /* 23 - Core 2 Duo */ ··· 447 module_init(intel_idle_init); 448 module_exit(intel_idle_exit); 449 450 module_param(max_cstate, int, 0444); 451 452 MODULE_AUTHOR("Len Brown <len.brown@intel.com>");