aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/idle/intel_idle.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/idle/intel_idle.c')
-rw-r--r--drivers/idle/intel_idle.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 6c0e0452dd9b..8e1939f564f4 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -635,39 +635,10 @@ static int __init intel_idle_cpuidle_driver_init(void)
635 */ 635 */
636static int intel_idle_cpu_init(int cpu) 636static int intel_idle_cpu_init(int cpu)
637{ 637{
638 int cstate;
639 struct cpuidle_device *dev; 638 struct cpuidle_device *dev;
640 639
641 dev = per_cpu_ptr(intel_idle_cpuidle_devices, cpu); 640 dev = per_cpu_ptr(intel_idle_cpuidle_devices, cpu);
642 641
643 dev->state_count = 1;
644
645 for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) {
646 int num_substates, mwait_hint, mwait_cstate, mwait_substate;
647
648 if (cpuidle_state_table[cstate].enter == NULL)
649 break;
650
651 if (cstate + 1 > max_cstate) {
652 printk(PREFIX "max_cstate %d reached\n", max_cstate);
653 break;
654 }
655
656 mwait_hint = flg2MWAIT(cpuidle_state_table[cstate].flags);
657 mwait_cstate = MWAIT_HINT2CSTATE(mwait_hint);
658 mwait_substate = MWAIT_HINT2SUBSTATE(mwait_hint);
659
660 /* does the state exist in CPUID.MWAIT? */
661 num_substates = (mwait_substates >> ((mwait_cstate + 1) * 4))
662 & MWAIT_SUBSTATE_MASK;
663
664 /* if sub-state in table is not enumerated by CPUID */
665 if ((mwait_substate + 1) > num_substates)
666 continue;
667
668 dev->state_count += 1;
669 }
670
671 dev->cpu = cpu; 642 dev->cpu = cpu;
672 643
673 if (cpuidle_register_device(dev)) { 644 if (cpuidle_register_device(dev)) {
@@ -679,6 +650,9 @@ static int intel_idle_cpu_init(int cpu)
679 if (icpu->auto_demotion_disable_flags) 650 if (icpu->auto_demotion_disable_flags)
680 smp_call_function_single(cpu, auto_demotion_disable, NULL, 1); 651 smp_call_function_single(cpu, auto_demotion_disable, NULL, 1);
681 652
653 if (icpu->disable_promotion_to_c1e)
654 smp_call_function_single(cpu, c1e_promotion_disable, NULL, 1);
655
682 return 0; 656 return 0;
683} 657}
684 658