Commit 5a4179460cb50d939a2ae713cf88fcbff75f2c1c

Authored by Linus Torvalds

Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6

* 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-idle-2.6:
  intel_idle: recognize Lincroft Atom Processor
  intel_idle: no longer EXPERIMENTAL
  intel_idle: disable module support
  intel_idle: add support for Westmere-EX
  intel_idle: delete power_policy modparam, and choose substate functions
  intel_idle: delete substates DEBUG modparam

Showing 2 changed files Side-by-side Diff

drivers/idle/Kconfig
1 1 config INTEL_IDLE
2   - tristate "Cpuidle Driver for Intel Processors"
  2 + bool "Cpuidle Driver for Intel Processors"
3 3 depends on CPU_IDLE
4 4 depends on X86
5 5 depends on CPU_SUP_INTEL
6   - depends on EXPERIMENTAL
7 6 help
8 7 Enable intel_idle, a cpuidle driver that includes knowledge of
9 8 native Intel hardware idle features. The acpi_idle driver
drivers/idle/intel_idle.c
... ... @@ -77,10 +77,8 @@
77 77 };
78 78 /* intel_idle.max_cstate=0 disables driver */
79 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 substates;
83   -static int (*choose_substate)(int);
  81 +static unsigned int mwait_substates;
84 82  
85 83 /* Reliable LAPIC Timer States, bit 1 for C1 etc. */
86 84 static unsigned int lapic_timer_reliable_states;
... ... @@ -168,41 +166,6 @@
168 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 = (substates >> ((cstate) * 4)) & MWAIT_SUBSTATE_MASK;
188   -
189   - if (num_substates <= 1)
190   - return 0;
191   -
192   - substate_choice = ((power_policy + (power_policy + 1) *
193   - (num_substates - 1)) / 16);
194   -
195   - return substate_choice;
196   -}
197   -
198   -/*
199   - * choose_zero_substate()
200   - */
201   -static int choose_zero_substate(int cstate)
202   -{
203   - return 0;
204   -}
205   -
206 169 /**
207 170 * intel_idle
208 171 * @dev: cpuidle_device
... ... @@ -220,8 +183,6 @@
220 183  
221 184 cstate = (((eax) >> MWAIT_SUBSTATE_SIZE) & MWAIT_CSTATE_MASK) + 1;
222 185  
223   - eax = eax + (choose_substate)(cstate);
224   -
225 186 local_irq_disable();
226 187  
227 188 if (!(lapic_timer_reliable_states & (1 << (cstate))))
... ... @@ -259,7 +220,7 @@
259 220 */
260 221 static int intel_idle_probe(void)
261 222 {
262   - unsigned int eax, ebx, ecx, edx;
  223 + unsigned int eax, ebx, ecx;
263 224  
264 225 if (max_cstate == 0) {
265 226 pr_debug(PREFIX "disabled\n");
266 227  
267 228  
... ... @@ -275,17 +236,13 @@
275 236 if (boot_cpu_data.cpuid_level < CPUID_MWAIT_LEAF)
276 237 return -ENODEV;
277 238  
278   - cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &edx);
  239 + cpuid(CPUID_MWAIT_LEAF, &eax, &ebx, &ecx, &mwait_substates);
279 240  
280 241 if (!(ecx & CPUID5_ECX_EXTENSIONS_SUPPORTED) ||
281 242 !(ecx & CPUID5_ECX_INTERRUPT_BREAK))
282 243 return -ENODEV;
283   -#ifdef DEBUG
284   - if (substates == 0) /* can over-ride via modparam */
285   -#endif
286   - substates = edx;
287 244  
288   - pr_debug(PREFIX "MWAIT substates: 0x%x\n", substates);
  245 + pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates);
289 246  
290 247 if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */
291 248 lapic_timer_reliable_states = 0xFFFFFFFF;
292 249  
293 250  
294 251  
... ... @@ -299,18 +256,18 @@
299 256 case 0x1E: /* Core i7 and i5 Processor - Lynnfield Jasper Forest */
300 257 case 0x1F: /* Core i7 and i5 Processor - Nehalem */
301 258 case 0x2E: /* Nehalem-EX Xeon */
  259 + case 0x2F: /* Westmere-EX Xeon */
302 260 lapic_timer_reliable_states = (1 << 1); /* C1 */
303 261  
304 262 case 0x25: /* Westmere */
305 263 case 0x2C: /* Westmere */
306 264 cpuidle_state_table = nehalem_cstates;
307   - choose_substate = choose_tunable_substate;
308 265 break;
309 266  
310 267 case 0x1C: /* 28 - Atom Processor */
  268 + case 0x26: /* 38 - Lincroft Atom Processor */
311 269 lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */
312 270 cpuidle_state_table = atom_cstates;
313   - choose_substate = choose_zero_substate;
314 271 break;
315 272 #ifdef FUTURE_USE
316 273 case 0x17: /* 23 - Core 2 Duo */
... ... @@ -376,7 +333,7 @@
376 333 }
377 334  
378 335 /* does the state exist in CPUID.MWAIT? */
379   - num_substates = (substates >> ((cstate) * 4))
  336 + num_substates = (mwait_substates >> ((cstate) * 4))
380 337 & MWAIT_SUBSTATE_MASK;
381 338 if (num_substates == 0)
382 339 continue;
383 340  
... ... @@ -450,11 +407,7 @@
450 407 module_init(intel_idle_init);
451 408 module_exit(intel_idle_exit);
452 409  
453   -module_param(power_policy, int, 0644);
454 410 module_param(max_cstate, int, 0444);
455   -#ifdef DEBUG
456   -module_param(substates, int, 0444);
457   -#endif
458 411  
459 412 MODULE_AUTHOR("Len Brown <len.brown@intel.com>");
460 413 MODULE_DESCRIPTION("Cpuidle driver for Intel Hardware v" INTEL_IDLE_VERSION);