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

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